<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0060)http://blog.csdn.net/shangmingchao/article/details/51125554/ -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/hm.js.下载"></script><script type="text/javascript" async="" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/mclm"></script>  

        
    <link rel="canonical" href="http://blog.csdn.net/"> 

   

  
 <meta http-equiv="Cache-Control" content="no-siteapp"><link rel="alternate" media="handheld" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#">

    <title>Glide使用详解（一） - 商明超的专栏
        - 博客频道 - CSDN.NET</title>
    
    <meta name="description" content="Glide使用 Glide使用教程 Glide详解 Android图片加载 一. 下载在build.gradle中添加依赖：    compile &#39;com.github.bumptech.glide:glide:3.7.0&#39;需要support-v4库的支持，如果你的项目没有support-v4库(项目默认已经添加了)，还需要添加s">
    <script src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/jquery.js.下载" type="text/javascript"></script>
      <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/jquery-version.js.下载"></script>
    
        <!--new top-->
       
        <link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/index.css">
        <!--new top-->
    
      <!-- ad begin -->
         <script language="javascript" type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/tracking.js.下载"></script>
    <!-- ad end-->

    <link rel="Stylesheet" type="text/css" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/style.css">

    

    <link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="http://blog.csdn.net/shangmingchao/rss/list">
    <link rel="shortcut icon" href="http://c.csdnimg.cn/public/favicon.ico">
    <link type="text/css" rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/default.css">
 

     
<script src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/share.js.下载"></script><link rel="stylesheet" type="text/css" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/job_reco.css"><link rel="stylesheet" type="text/css" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/style(1).css"><link rel="stylesheet" type="text/css" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/style(2).css"><script src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/logger.js.下载"></script><link href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/bdsstyle.css" rel="stylesheet" type="text/css"><style type="text/css">.MathJax_Hover_Frame {border-radius: .25em; -webkit-border-radius: .25em; -moz-border-radius: .25em; -khtml-border-radius: .25em; box-shadow: 0px 0px 15px #83A; -webkit-box-shadow: 0px 0px 15px #83A; -moz-box-shadow: 0px 0px 15px #83A; -khtml-box-shadow: 0px 0px 15px #83A; border: 1px solid #A6D ! important; display: inline-block; position: absolute}
.MathJax_Hover_Arrow {position: absolute; width: 15px; height: 11px; cursor: pointer}
</style><style type="text/css">#MathJax_About {position: fixed; left: 50%; width: auto; text-align: center; border: 3px outset; padding: 1em 2em; background-color: #DDDDDD; color: black; cursor: default; font-family: message-box; font-size: 120%; font-style: normal; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px; -khtml-border-radius: 15px; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
.MathJax_Menu {position: absolute; background-color: white; color: black; width: auto; padding: 2px; border: 1px solid #CCCCCC; margin: 0; cursor: default; font: menu; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
.MathJax_MenuItem {padding: 2px 2em; background: transparent}
.MathJax_MenuArrow {position: absolute; right: .5em; color: #666666}
.MathJax_MenuActive .MathJax_MenuArrow {color: white}
.MathJax_MenuArrow.RTL {left: .5em; right: auto}
.MathJax_MenuCheck {position: absolute; left: .7em}
.MathJax_MenuCheck.RTL {right: .7em; left: auto}
.MathJax_MenuRadioCheck {position: absolute; left: 1em}
.MathJax_MenuRadioCheck.RTL {right: 1em; left: auto}
.MathJax_MenuLabel {padding: 2px 2em 4px 1.33em; font-style: italic}
.MathJax_MenuRule {border-top: 1px solid #CCCCCC; margin: 4px 1px 0px}
.MathJax_MenuDisabled {color: GrayText}
.MathJax_MenuActive {background-color: Highlight; color: HighlightText}
.MathJax_Menu_Close {position: absolute; width: 31px; height: 31px; top: -15px; left: -15px}
</style><style type="text/css">#MathJax_Zoom {position: absolute; background-color: #F0F0F0; overflow: auto; display: block; z-index: 301; padding: .5em; border: 1px solid black; margin: 0; font-weight: normal; font-style: normal; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; box-shadow: 5px 5px 15px #AAAAAA; -webkit-box-shadow: 5px 5px 15px #AAAAAA; -moz-box-shadow: 5px 5px 15px #AAAAAA; -khtml-box-shadow: 5px 5px 15px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
#MathJax_ZoomOverlay {position: absolute; left: 0; top: 0; z-index: 300; display: inline-block; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
#MathJax_ZoomFrame {position: relative; display: inline-block; height: 0; width: 0}
#MathJax_ZoomEventTrap {position: absolute; left: 0; top: 0; z-index: 302; display: inline-block; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
</style><style type="text/css">.MathJax_Preview {color: #888}
#MathJax_Message {position: fixed; left: 1em; bottom: 1.5em; background-color: #E6E6E6; border: 1px solid #959595; margin: 0px; padding: 2px 8px; z-index: 102; color: black; font-size: 80%; width: auto; white-space: nowrap}
#MathJax_MSIE_Frame {position: absolute; top: 0; left: 0; width: 0px; z-index: 101; border: 0px; margin: 0px; padding: 0px}
.MathJax_Error {color: #CC0000; font-style: italic}
</style><link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/share_style0_16.css"></head>


<body class="csdn-tracking-statistics" data-mod="popu_307"><div id="BAIDU_DUP_fp_wrapper" style="position: absolute; left: -1px; bottom: -1px; z-index: 0; width: 0px; height: 0px; overflow: hidden; visibility: hidden; display: none;"><iframe id="BAIDU_DUP_fp_iframe" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/o.html" style="width: 0px; height: 0px; visibility: hidden; display: none;"></iframe></div><div id="MathJax_Message" style="display: none;"></div><iframe frameborder="0" style="display: none;" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/saved_resource.html"></iframe>
       



    <!-- 广告位开始 -->
        
    <!-- 广告位结束 -->

    
   
      <!--new top-->
    <script id="toolbar-tpl-scriptId" fixed="true" prod="blog" skin="black" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/html.js.下载" type="text/javascript"></script><div class="csdn-toolbar csdn-toolbar-skin-black ">        <div class="container row center-block ">          <div class="col-md-3 pull-left logo clearfix"><a href="http://www.csdn.net/?ref=toolbar" title="CSDN首页" target="_blank" class="icon"></a><a title="频道首页" href="http://blog.csdn.net/?ref=toolbar_logo" class="img blog-icon"></a></div>          <div class="pull-right login-wrap ">            <ul class="btns">              <li class="loginlink"><a href="https://passport.csdn.net/account/login?ref=toolbar" target="_top">登录&nbsp;</a>|<a target="_top" href="http://passport.csdn.net/account/mobileregister?ref=toolbar&amp;action=mobileRegister">&nbsp;注册</a></li>              <li class="search">                <div class="icon on-search-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <form action="http://so.csdn.net/search" method="get" target="_blank">                      <input type="hidden" value="toolbar" name="ref" accesskey="2">                      <div class="border">                        <input placeholder="搜索" type="text" value="" name="q" accesskey="2"><span class="icon-enter-sm"></span>                      </div>                    </form>                  </div>                </div>              </li>              <li class="favor">                <div class="icon on-favor-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div style="display:none;" class="favor-success"><span class="msg">收藏成功</span>                      <div class="btns"><span class="btn btn-primary ok">确定</span></div>                    </div>                    <div style="display:none;" class="favor-failed"><span class="icon-danger-lg"></span><span class="msg">收藏失败，请重新收藏</span>                      <div class="btns"><span class="btn btn-primary ok">确定</span></div>                    </div>                    <form role="form" class="form-horizontal favor-form">                      <div class="form-group">                        <div class="clearfix">                          <label for="input-title" class="col-sm-2 control-label"><span class="red_txt">*</span>标题</label>                          <div class="col-sm-10">                            <input id="inputTitle" type="text" placeholder="" class="title form-control">                          </div>                        </div>                        <div class="alert alert-danger"><strong></strong>标题不能为空</div>                      </div>                      <div class="form-group" style="display:none;">                        <label for="input-url" class="col-sm-2 control-label">网址</label>                        <div class="col-sm-10">                          <input id="input-url" type="text" placeholder="" class="url form-control">                        </div>                      </div>                      <div class="form-group">                        <label for="input-tag" class="col-sm-2 tag control-label">标签</label>                        <div class="col-sm-10">                          <input id="input-tag" type="text" class="form-control tag">                        </div>                      </div>                      <div class="form-group">                        <label for="input-description" class="description col-sm-2 control-label">位置</label>                        <div class="col-sm-10">                          <div class="my_lib_box">                            个人主页&nbsp;-&nbsp;<a href="http://my.csdn.net/" target="_blank">我的知识</a>                          </div>                          <div class="checkbox">                            <div class="pull-left">                              <label>                                <input type="checkbox" name="share" class="save_lib_map" checked="checked">同时保存至：                              </label>                            </div>                            <div class="pull-left">                              <div class="dropdown">                                <button id="toolbar_sele_map" type="button">                                  选择知识图谱                                  <i class="fa fa-chevron-down"></i>                                </button>                                <div class="top_arr"></div>                                <div class="outside">                                  <ul class="dropdown-menu" id="toolbar_Design_knowledge"><li>选择知识图谱</li></ul>                                </div>                              </div>                            </div>                            <div class="pull-left new_txt">                              <a href="http://lib.csdn.net/my/create/structure" target="_blank">新建？</a>                            </div>                          </div>                        </div>                      </div>                      <div class="form-group">                        <div class="col-sm-offset-2 col-sm-10 ft">                          <div class="col-sm-4 pull-left" style="display:none">                            <div class="checkbox">                              <label>                                <input type="checkbox" name="share" checked="checked" class="share">公开                              </label>                            </div>                          </div>                          <div class="col-sm-8 pull-right favor-btns">                            <button type="button" class="cancel btn btn-default">取消</button>                            <button type="submit" class="submit btn btn-primary">收藏</button>                          </div>                        </div>                      </div>                    </form>                  </div>                </div>              </li>              <li class="notify">                <div style="display:none" class="number"></div>                <div style="" class="icon-hasnotes-sm"></div>                <div id="header_notice_num"><div class="icon-hasnotes" style=""></div></div>                <div class="icon on-notify-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div id="note1" class="csdn_note" style="display: none; left: -212px; top: 11377px;">                      <div class="box"><div class="notifications notice_list_con curr">  <div class="menu_title">    <span class="title"><a href="http://msg.csdn.net/letters" target="_blank" class="read_all">查看所有私信</a><a href="http://msg.csdn.net/" target="_blank" class="go_all">查看所有通知</a></span>  </div>  <div class="loading"></div>  <div class="empty">暂没有新通知</div>  <div class="notice_content" style="overflow-y: auto; max-height: 270px;"></div></div><div class="notifications detail_con" style="display: none">  <div class="menu_title">    <span class="title">      <a class="go_back" href="javascript:void 0;">返回通知列表</a>      <a class="notifications_page_none nextnote" href="javascript:void 0;">下一条</a>      <a class="notifications_page prvnote" href="javascript:void 0;">上一条</a>    </span>  </div>  <div class="notice_content" style="overflow-y: scroll; height: 250px;"></div></div><div class="error"></div></div>                    <iframe src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/saved_resource(1).html" frameborder="0" allowtransparency="true" style="z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;background:transparent"></iframe></div>                  </div>                </div>              </li>              <li class="ugc">                <div class="icon on-ugc-icon">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <dl>                      <dt><a href="http://geek.csdn.net/news/expert?ref=toolbar" target="_blank" class="p-news clearfix" style="display:none;"><em class="icon"></em><span>分享资讯</span></a></dt>                      <dt style="border: none;"><a href="http://u.download.csdn.net/upload?ref=toolbar" target="_blank" class="p-doc clearfix"><em class="icon"></em><span>传PPT/文档</span></a></dt>                      <dt><a href="http://bbs.csdn.net/topics/new?ref=toolbar" target="_blank" class="p-ask clearfix"><em class="icon"></em><span>提问题</span></a></dt>                      <dt><a href="http://write.blog.csdn.net/postedit?ref=toolbar" target="_blank" class="p-blog clearfix"><em class="icon"></em><span>写博客</span></a></dt>                      <dt><a href="http://u.download.csdn.net/upload?ref=toolbar" target="_blank" class="p-src clearfix"><em class="icon"></em><span>传资源</span></a></dt>                      <dt><a href="https://code.csdn.net/projects/new?ref=toolbar" target="_blank" class="c-obj clearfix"><em class="icon"></em><span>创建项目</span></a></dt>                      <dt><a href="https://code.csdn.net/snippets/new?ref=toolbar" target="_blank" class="c-code clearfix"><em class="icon"></em><span>创建代码片</span></a></dt>                    </dl>                  </div>                </div>              </li>              <li class="profile">                <div class="icon on-profile-icon"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/2_jiangsheng1987.jpg" class="curr-icon-img">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div class="bd">                      <dl class="clearfix">                        <dt class="pull-left img"><a target="_blank" href="http://my.csdn.net/?ref=toolbar" class="avatar"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/2_jiangsheng1987.jpg"></a></dt>                        <dd class="info" style="border: none;"><a target="_blank" href="http://my.csdn.net/?ref=toolbar" class="nickname">jiangsheng1987</a><span class="dec"><a class="fill-dec" href="http://my.csdn.net/" target="_blank">编辑自我介绍，让更多人了解你<span class="write-icon"></span></a></span></dd>                      </dl>                    </div>                    <div class="ft clearfix"><a target="_blank" href="http://my.csdn.net/my/account/changepwd?ref=toolbar" class="pull-left"><span class="icon-cog"></span>帐号设置</a><a href="https://passport.csdn.net/account/logout?ref=toolbar" target="_top" class="pull-left" style="margin-left:132px; width:18px; height:27px; white-space:nowrap; overflow:hidden;"><span class="icon-signout"></span><span class="out">退出</span></a></div>                  </div>                </div>              </li>              <li class="apps">                <div id="chasnew123" class="hasnew" style="display: none;"></div>                <div id="cappsarea123" class="icon on-apps-icon">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                  <div class="detail">                    <dl>                      <dt>                        <h5>社区</h5>                      </dt>                      <dd> <a href="http://blog.csdn.net/?ref=toolbar" target="_blank">博客</a></dd>                      <dd> <a href="http://bbs.csdn.net/?ref=toolbar" target="_blank">论坛</a></dd>                      <dd> <a href="http://download.csdn.net/?ref=toolbar" target="_blank">下载</a></dd>                      <dd> <a href="http://lib.csdn.net/?ref=toolbar" target="_blank">知识库</a></dd>                      <dd><a href="http://ask.csdn.net/?ref=toolbar" target="_blank">技术问答</a></dd>                      <dd><a href="http://geek.csdn.net/?ref=toolbar" target="_blank">极客头条</a></dd>                      <dd style="display:none"> <a href="http://hero.csdn.net/?ref=toolbar" target="_blank">英雄会</a></dd>                    </dl>                  </div>                  <div class="detail">                    <dl>                      <dt>                        <h5>服务</h5>                      </dt>                      <dd style="display:none"> <a href="http://job.csdn.net/?ref=toolbar" target="_blank">JOB<img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/new.gif" style="display: none; margin-top: -26px; width: 23px;"></a></dd>                      <dd> <a href="http://edu.csdn.net/?ref=toolbar" target="_blank">学院<img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/new.gif" style="display: none; margin-top: -26px; width: 23px;"></a></dd>                      <dd> <a href="https://code.csdn.net/?ref=toolbar" target="_blank">CODE</a></dd>                      <dd> <a href="http://huiyi.csdn.net/?ref=toolbar" target="_blank">活动</a></dd>                      <dd> <a href="http://www.csto.com/?ref=toolbar" target="_blank">CSTO</a></dd>                      <dd> <a href="http://mall.csdn.net/?ref=toolbar" target="_blank">C币兑换<img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/new.gif" style="display: none; margin-top: -26px; width: 23px;"></a></dd>                    </dl>                  </div>                  <div class="detail last">                    <dl>                      <dt>                        <h5>俱乐部</h5>                      </dt>                      <dd> <a href="http://cto.csdn.net/?ref=toolbar" target="_blank">CTO俱乐部</a></dd>                      <dd> <a href="http://student.csdn.net/?ref=toolbar" target="_blank">高校俱乐部</a></dd>                    </dl>                  </div>                </div>              </div>            </li>            </ul>          </div>        </div>    </div>
     <!--new top-->
    <div id="container">
        <div id="header">
    <div class="header">
        <div id="blog_title">
            <h2>
                <a href="http://blog.csdn.net/shangmingchao">商明超的专栏</a></h2>
            <h3>Android进阶中……</h3>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
        
     
    </div>
</div>
<div id="navigator">
    <div class="navigator_bg">
    </div>
    <div class="navigator">
        <ul>           
                <li id="btnContents"><a href="http://blog.csdn.net/shangmingchao?viewmode=contents"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_mulu&#39;])">
                    <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/ico_list.gif">目录视图</span></a></li>
                <li id="btnView"><a href="http://blog.csdn.net/shangmingchao?viewmode=list"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_zhaiyao&#39;])">
                    <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/ico_summary.gif">摘要视图</span></a></li>
                <li id="btnRss"><a href="http://blog.csdn.net/shangmingchao/rss/list"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_RSS&#39;])">
                    <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/ico_rss.gif">订阅</span></a></li>                
            

            </ul>
    </div>
</div>
<script type="text/javascript">
    var username = "shangmingchao";
    var _blogger = username;
    var blog_address = "http://blog.csdn.net/shangmingchao";
    var static_host = "http://static.blog.csdn.net";
    var currentUserName = "jiangsheng1987";  
</script>

        <div id="body">
            <div id="main">
                <div class="main">
                        <div class="ad_class">
<div class="notice tracking-ad" data-mod="popu_3"> 


<a href="http://blog.csdn.net/blogdevteam/article/details/71710175" target="_blank">
<font color="blue"><strong>【有奖征文】Bluemix云上实践征集喽~ </strong></font></a>

&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://bss.csdn.net/m/product/python_creative" target="_blank">
<font color="red"><strong>Python 创意编程活动</strong></font></a>
&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://blog.csdn.net/blogdevteam/article/details/71699875" target="_blank">
<font color="blue"><strong>CSDN日报20170511 ——《开发人员的必备技能》
</strong>
</font></a>
</div>                        </div>
                        



  
<link href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/comment1.css" type="text/css" rel="stylesheet">
<link href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/style1.css" type="text/css" rel="stylesheet">


<link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/markdown_views.css">
<link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/category.css">

<script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/category.js.下载"></script>

  <script type="text/ecmascript">
      window.quickReplyflag = true;
           
            var isBole = false;
            
      
      var fasrc="http://my.csdn.net/my/favorite/miniadd?t=Glide%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3%ef%bc%88%e4%b8%80%ef%bc%89&u=http://blog.csdn.net/shangmingchao/article/details/51125554/"

    </script>
<div id="article_details" class="details">
    <div class="article_title">   
         <span class="ico ico_type_Original"></span>


    <h1>
        <span class="link_title"><a href="http://blog.csdn.net/shangmingchao/article/details/51125554">
        Glide使用详解（一）            
        </a></span>
    </h1>
</div>

   

        <div class="article_manage clearfix">
        <div class="article_l">
            <span class="link_categories">
            标签：
              <a href="http://www.csdn.net/tag/Glide" target="_blank" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_tag&#39;]);">Glide</a><a href="http://www.csdn.net/tag/Glide%e4%bd%bf%e7%94%a8" target="_blank" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_tag&#39;]);">Glide使用</a><a href="http://www.csdn.net/tag/Glide%e8%af%a6%e8%a7%a3" target="_blank" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_tag&#39;]);">Glide详解</a><a href="http://www.csdn.net/tag/Glide%e6%95%99%e7%a8%8b" target="_blank" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_tag&#39;]);">Glide教程</a>
            </span>
        </div>
        <div class="article_r">
            <span class="link_postdate">2016-04-12 12:25</span>
            <span class="link_view" title="阅读次数">48751人阅读</span>
            <span class="link_comments" title="评论次数"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#comments" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_pinglun&#39;])">评论</a>(56)</span>
            <span class="link_collect tracking-ad" data-mod="popu_171"> <a href="javascript:void(0);" onclick="javascript:collectArticle(&#39;Glide%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3%ef%bc%88%e4%b8%80%ef%bc%89&#39;,&#39;51125554&#39;);return false;" title="收藏" target="_blank">收藏</a></span>
             <span class="link_report"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" onclick="javascript:report(51125554,2);return false;" title="举报">举报</a></span>

        </div>
    </div>
    <div class="embody" style="display:none" id="embody">
        <span class="embody_t">本文章已收录于：</span>
        <div class="embody_c" id="lib" value="{&quot;err&quot;:0,&quot;msg&quot;:&quot;ok&quot;,&quot;data&quot;:[]}"></div>
    </div>
    <style type="text/css">        
            .embody{
                padding:10px 10px 10px;
                margin:0 -20px;
                border-bottom:solid 1px #ededed;                
            }
            .embody_b{
                margin:0 ;
                padding:10px 0;
            }
            .embody .embody_t,.embody .embody_c{
                display: inline-block;
                margin-right:10px;
            }
            .embody_t{
                font-size: 12px;
                color:#999;
            }
            .embody_c{
                font-size: 12px;
            }
            .embody_c img,.embody_c em{
                display: inline-block;
                vertical-align: middle;               
            }
             .embody_c img{               
                width:30px;
                height:30px;
            }
            .embody_c em{
                margin: 0 20px 0 10px;
                color:#333;
                font-style: normal;
            }
    </style>
    <script type="text/javascript">
        $(function () {
            try
            {
                var lib = eval("("+$("#lib").attr("value")+")");
                var html = "";
                if (lib.err == 0) {
                    $.each(lib.data, function (i) {
                        var obj = lib.data[i];
                        //html += '<img src="' + obj.logo + '"/>' + obj.name + "&nbsp;&nbsp;";
                        html += ' <a href="' + obj.url + '" target="_blank">';
                        html += ' <img src="' + obj.logo + '">';
                        html += ' <em><b>' + obj.name + '</b></em>';
                        html += ' </a>';
                    });
                    if (html != "") {
                        setTimeout(function () {
                            $("#lib").html(html);                      
                            $("#embody").show();
                        }, 100);
                    }
                }      
            } catch (err)
            { }
            
        });
    </script>
      <div class="category clearfix">
        <div class="category_l">
           <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/category_icon.jpg">
            <span>分类：</span>
        </div>
        <div class="category_r">
                    <label onclick="GetCategoryArticles(&#39;1730835&#39;,&#39;shangmingchao&#39;,&#39;top&#39;,&#39;51125554&#39;);">
                        <span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_fenlei&#39;]);">Android<em>（28）</em></span>
                      <img class="arrow-down" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/arrow_triangle _down.jpg" style="display:inline;">
                      <img class="arrow-up" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/arrow_triangle_up.jpg" style="display:none;">
                        <div class="subItem">
                            <div class="subItem_t"><a href="http://blog.csdn.net/shangmingchao/article/category/1730835" target="_blank">作者同类文章</a><i class="J_close">X</i></div>
                            <ul class="subItem_l" id="top_1730835">                            
                            </ul>
                        </div>
                    </label>                    
        </div>
    </div>
        <div class="bog_copyright">         
            <p class="copyright_p">版权声明：如需转载，请标明出处：http://blog.csdn.net/shangmingchao【商明超的博客】</p>
        </div>

  

  
  
     

<div style="clear:both"></div><div style="border:solid 1px #ccc; background:#eee; float:left; min-width:200px;padding:4px 10px;"><p style="text-align:right;margin:0;"><span style="float:left;">目录<a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" title="系统根据文章中H1到H6标签自动生成文章目录">(?)</a></span><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" onclick="javascript:return openct(this);" title="展开">[+]</a></p><ol style="display:none;margin-left:14px;padding-left:14px;line-height:160%;"><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t0">一 下载</a></li><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t1">二 集成网络框架OkHttp可选</a></li><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t2">三 使用</a></li><ol><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t3">简单使用</a></li><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t4">Glidewith使用</a></li><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t5">requestManagerload使用</a></li><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t6">GenericRequestBuilder使用</a></li><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t7">技巧</a></li></ol><li><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#t8">四 Glide有哪些坑</a></li></ol></div><div style="clear:both"></div><div id="article_content" class="article_content">
        <div class="markdown_views"><h3 id="一-下载"><a name="t0"></a><strong>一. 下载</strong></h3>

<p>在build.gradle中添加依赖：</p>



<pre class="prettyprint" name="code"><code class="language-gradle hljs bash has-numbering">    compile <span class="hljs-string">'com.github.bumptech.glide:glide:3.7.0'</span></code><ul class="pre-numbering" style="opacity: 0;"><li>1</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li></ul></pre>

<p>需要support-v4库的支持，如果你的项目没有support-v4库(项目默认已经添加了)，还需要添加support-v4依赖：</p>



<pre class="prettyprint" name="code"><code class="language-gradle hljs bash has-numbering">    compile <span class="hljs-string">'com.android.support:support-v4:23.3.0'</span></code><ul class="pre-numbering" style="opacity: 0;"><li>1</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li></ul></pre>

<p>然后配置混淆规则：</p>



<pre class="prettyprint" name="code"><code class="hljs java has-numbering">    -keep <span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> * <span class="hljs-keyword">implements</span> <span class="hljs-title">com</span>.<span class="hljs-title">bumptech</span>.<span class="hljs-title">glide</span>.<span class="hljs-title">module</span>.<span class="hljs-title">GlideModule</span>
    -<span class="hljs-title">keep</span> <span class="hljs-title">public</span> <span class="hljs-title">enum</span> <span class="hljs-title">com</span>.<span class="hljs-title">bumptech</span>.<span class="hljs-title">glide</span>.<span class="hljs-title">load</span>.<span class="hljs-title">resource</span>.<span class="hljs-title">bitmap</span>.<span class="hljs-title">ImageHeaderParser</span>$** {</span>
      **[] $VALUES;
      <span class="hljs-keyword">public</span> *;
    }</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul></pre>

<p>其中第一个混淆规则表明不混淆所有的<code>GlideModule</code>。 <br>
如果需要的话，还需添加相应的权限：</p>



<pre class="prettyprint" name="code"><code class="language-xml hljs  has-numbering">    <span class="hljs-tag">&lt;<span class="hljs-title">uses-permission</span> <span class="hljs-attribute">android:name</span>=<span class="hljs-value">"android.permission.INTERNET"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">uses-permission</span> <span class="hljs-attribute">android:name</span>=<span class="hljs-value">"android.permission.WRITE_EXTERNAL_STORAGE"</span> /&gt;</span></code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li></ul></pre>

<p>Glide Repo：<a href="https://github.com/bumptech/glide" target="_blank">bumptech/glide</a></p>



<h3 id="二-集成网络框架okhttp可选"><a name="t1"></a><strong>二. 集成网络框架OkHttp（可选）</strong></h3>

<p>Glide的网络请求部分可以使用当前最流行的网络请求框架Volley或OkHttp，也可以通过Glide的ModelLoader接口自己写网络请求。 <br>
Glide默认使用<code>HttpUrlConnection</code>进行网络请求，为了让APP保持一致的网络请求形式，可以让Glide使用我们指定的网络请求形式请求网络资源，这里我们选<a href="https://github.com/square/okhttp" target="_blank">OkHttp</a> (具有支持HTTP/2、利用连接池技术减少请求延迟、缓存响应结果等等优点)，需要添加一个集成库：</p>

<pre class="prettyprint" name="code"><code class="language-gradle hljs cs has-numbering">    <span class="hljs-comment">//OkHttp 2.x</span>
    <span class="hljs-comment">//compile 'com.github.bumptech.glide:okhttp-integration:1.4.0@aar'</span>
    <span class="hljs-comment">//compile 'com.squareup.okhttp:okhttp:2.7.5'</span>

    <span class="hljs-comment">//OkHttp 3.x</span>
    compile <span class="hljs-string">'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'</span>
    compile <span class="hljs-string">'com.squareup.okhttp3:okhttp:3.2.0'</span></code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li></ul></pre>

<blockquote>
  <p>注意： <br>
  1. OkHttp 2.x和OkHttp 3.x需使用不同的集成库。 <br>
  2. Gradle会自动将OkHttpGlideModule合并到应用的manifest文件中。 <br>
  3. 如果你没有对所有的<code>GlideModule</code>配置混淆规则(即没有使用<code>-keep public class * implements com.bumptech.glide.module.GlideModule</code>)，则需要把OkHttp的<code>GlideModule</code>进行防混淆配置：</p>
  
  <pre class="prettyprint" name="code"><code class="hljs avrasm has-numbering">-keep class <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.bumptech</span><span class="hljs-preprocessor">.glide</span><span class="hljs-preprocessor">.integration</span><span class="hljs-preprocessor">.okhttp</span><span class="hljs-preprocessor">.OkHttpGlideModule</span></code><ul class="pre-numbering" style="opacity: 0;"><li>1</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets_01.png"></a></div><ul class="pre-numbering"><li>1</li></ul></pre>
</blockquote>



<h3 id="三-使用"><a name="t2"></a><strong>三. 使用</strong></h3>



<h4 id="简单使用"><a name="t3"></a><strong>简单使用</strong>：</h4>



<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">Glide
    .with(<span class="hljs-keyword">this</span>)
    .load(<span class="hljs-string">"http://inthecheesefactory.com/uploads/source/nestedfragment/fragments.png"</span>)
    .into(imageView);</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li></ul></pre>



<h4 id="glidewith使用"><a name="t4"></a><strong>Glide.with()使用</strong></h4>

<ol>
<li>with(Context context). 使用Application上下文，Glide请求将不受Activity/Fragment生命周期控制。</li>
<li>with(Activity activity).使用Activity作为上下文，Glide的请求会受到Activity生命周期控制。</li>
<li>with(FragmentActivity activity).Glide的请求会受到FragmentActivity生命周期控制。</li>
<li>with(android.app.Fragment fragment).Glide的请求会受到Fragment 生命周期控制。</li>
<li>with(android.support.v4.app.Fragment fragment).Glide的请求会受到Fragment生命周期控制。</li>
</ol>

<p>返回关联了相应上下文的<code>RequestManager</code>实例。</p>



<h4 id="requestmanagerload使用"><a name="t5"></a><strong>requestManager.load()使用</strong></h4>

<p>Glide基本可以load任何可以拿到的媒体资源，如： <br>
load <strong>SD卡资源</strong>：load("file://"+ Environment.getExternalStorageDirectory().getPath()+"/test.jpg") <br>
load <strong>assets资源</strong>：load("file:///android_asset/f003.gif") <br>
load <strong>raw资源</strong>：load("<a href="http://lib.csdn.net/base/android" class="replace_word" title="Android知识库" target="_blank" style="color:#df3434; font-weight:bold;">Android</a>.resource://com.frank.glide/raw/raw_1")或load("android.resource://com.frank.glide/raw/"+R.raw.raw_1) <br>
load <strong>drawable资源</strong>：load("android.resource://com.frank.glide/drawable/news")或load("android.resource://com.frank.glide/drawable/"+R.drawable.news) <br>
load <strong>ContentProvider资源</strong>：load("content://media/external/images/media/139469") <br>
load <strong>http资源</strong>：load("<span><a href="http://img.my.csdn.net/uploads/201508/05/1438760757_3588.jpg" target="_blank">http://img.my.csdn.net/uploads/201508/05/1438760757_3588.jpg</a></span>") <br>
load <strong>https资源</strong>：load("<span><a href="https://img.alicdn.com/tps/TB1uyhoMpXXXXcLXVXXXXXXXXXX-476-538.jpg_240x5000q50.jpg_.webp" target="_blank">https://img.alicdn.com/tps/TB1uyhoMpXXXXcLXVXXXXXXXXXX-476-538.jpg_240x5000q50.jpg_.webp</a><span>") <br>
当然，load不限于String类型，还可以： <br>
<code>load(Uri uri)</code>，<code>load(File file)</code>，<code>load(Integer resourceId)</code>，<code>load(URL url)</code>，<code>load(byte[] model)</code>，<code>load(T model)</code>，<code>loadFromMediaStore(Uri uri)</code>。 <br>
load的资源也可以是本地视频，如果想要load网络视频或更高级的操作可以使用<code>VideoView</code>等其它控件完成。 <br>
而且可以使用自己的<code>ModelLoader</code>进行资源加载： <br>
<code>using(ModelLoader&lt;A, T&gt; modelLoader, Class&lt;T&gt; dataClass)</code>，<code>using(final StreamModelLoader&lt;T&gt; modelLoader)</code>，<code>using(StreamByteArrayLoader modelLoader)</code>，<code>using(final FileDescriptorModelLoader&lt;T&gt; modelLoader)</code>。 <br>
返回GenericRequestBuilder实例。</span></span></p>



<h4 id="genericrequestbuilder使用"><a name="t6"></a><strong>GenericRequestBuilder使用</strong></h4>

<p><code>GenericRequestBuilder&lt;ModelType,DataType,ResourceType,TranscodeType&gt;</code>是最顶层的Request Builder，用于处理选项设置和开始一般resource类型资源的加载。其中<code>ModelType</code>是指代表资源的类型，如"<span><a href="http://img.my.csdn.net/uploads/201508/05/1438760757_3588.jpg" target="_blank">http://img.my.csdn.net/uploads/201508/05/1438760757_3588.jpg</a></span>"这个String就代表了一张图片资源，所以这个ModelType就是String。<code>DataType</code>是指ModelLoader提供的，可以被ResourceDecoder解码的数据类型。<code>ResourceType</code>是指将要加载的resource类型。<code>TranscodeType</code>是指已解码的资源将要被转成的资源类型。</p>

<ol>
<li>thumbnail(float sizeMultiplier). 请求给定系数的缩略图。如果缩略图比全尺寸图先加载完，就显示缩略图，否则就不显示。系数sizeMultiplier必须在(0,1)之间，可以递归调用该方法。</li>
<li>sizeMultiplier(float sizeMultiplier). 在加载资源之前给Target大小设置系数。</li>
<li>diskCacheStrategy(DiskCacheStrategy strategy).设置缓存策略。DiskCacheStrategy.SOURCE：缓存原始数据，DiskCacheStrategy.RESULT：缓存变换(如缩放、裁剪等)后的资源数据，DiskCacheStrategy.NONE：什么都不缓存，DiskCacheStrategy.ALL：缓存SOURC和RESULT。默认采用DiskCacheStrategy.RESULT策略，对于download only操作要使用DiskCacheStrategy.SOURCE。</li>
<li>priority(Priority priority). 指定加载的优先级，优先级越高越优先加载，但不保证所有图片都按序加载。枚举Priority.IMMEDIATE，Priority.HIGH，Priority.NORMAL，Priority.LOW。默认为Priority.NORMAL。</li>
<li>dontAnimate(). 移除所有的动画。</li>
<li>animate(int animationId). 在异步加载资源完成时会执行该动画。</li>
<li>animate(ViewPropertyAnimation.Animator animator). 在异步加载资源完成时会执行该动画。</li>
<li>placeholder(int resourceId). 设置资源加载过程中的占位Drawable。</li>
<li>placeholder(Drawable drawable). 设置资源加载过程中的占位Drawable。</li>
<li>fallback(int resourceId). 设置model为空时要显示的Drawable。如果没设置fallback，model为空时将显示error的Drawable，如果error的Drawable也没设置，就显示placeholder的Drawable。</li>
<li>fallback(Drawable drawable).设置model为空时显示的Drawable。</li>
<li>error(int resourceId).设置load失败时显示的Drawable。</li>
<li>error(Drawable drawable).设置load失败时显示的Drawable。</li>
<li>listener(RequestListener&lt;? super ModelType, TranscodeType&gt; requestListener). 监听资源加载的请求状态，可以使用两个回调：<code>onResourceReady(R resource, T model, Target&lt;R&gt; target, boolean isFromMemoryCache, boolean isFirstResource)</code>和<code>onException(Exception e, T model, Target&amp;lt;R&amp;gt; target, boolean isFirstResource)</code>，但不要每次请求都使用新的监听器，要避免不必要的内存申请，可以使用单例进行统一的异常监听和处理。</li>
<li>skipMemoryCache(boolean skip). 设置是否跳过内存缓存，但不保证一定不被缓存（比如请求已经在加载资源且没设置跳过内存缓存，这个资源就会被缓存在内存中）。</li>
<li>override(int width, int height). 重新设置Target的宽高值（单位为pixel）。</li>
<li>into(Y target).设置资源将被加载到的Target。</li>
<li>into(ImageView view). 设置资源将被加载到的ImageView。取消该ImageView之前所有的加载并释放资源。</li>
<li>into(int width, int height). 后台线程加载时要加载资源的宽高值（单位为pixel）。</li>
<li>preload(int width, int height). 预加载resource到缓存中（单位为pixel）。</li>
<li>asBitmap(). 无论资源是不是gif动画，都作为Bitmap对待。如果是gif动画会停在第一帧。</li>
<li>asGif().把资源作为GifDrawable对待。如果资源不是gif动画将会失败，会回调<code>.error()</code>。</li>
</ol>



<h4 id="技巧"><a name="t7"></a><strong>技巧</strong>：</h4>

<ol>
<li><p>禁止内存缓存：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">    .skipMemoryCache(<span class="hljs-keyword">true</span>)</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets_01.png"></a></div><ul class="pre-numbering"><li>1</li></ul></pre></li>
<li><p>清除内存缓存：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">    <span class="hljs-comment">// 必须在UI线程中调用</span>
    Glide.get(context).clearMemory();</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets_01.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li></ul></pre></li>
<li><p>禁止磁盘缓存：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">   .diskCacheStrategy(DiskCacheStrategy.NONE)</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets_01.png"></a></div><ul class="pre-numbering"><li>1</li></ul></pre></li>
<li><p>清除磁盘缓存：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">   <span class="hljs-comment">// 必须在后台线程中调用，建议同时clearMemory()</span>
   Glide.get(applicationContext).clearDiskCache();</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li></ul></pre></li>
<li><p>获取缓存大小：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">   <span class="hljs-keyword">new</span> GetDiskCacheSizeTask(textView).execute(<span class="hljs-keyword">new</span> File(getCacheDir(), DiskCache.Factory.DEFAULT_DISK_CACHE_DIR));</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li></ul></pre>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">class GetDiskCacheSizeTask extends AsyncTask&lt;File, Long, Long&gt; {
<span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> TextView resultView;

<span class="hljs-keyword">public</span> <span class="hljs-title">GetDiskCacheSizeTask</span>(TextView resultView) {
    <span class="hljs-keyword">this</span>.resultView = resultView;
}

<span class="hljs-annotation">@Override</span>
<span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onPreExecute</span>() {
    resultView.setText(<span class="hljs-string">"Calculating..."</span>);
}

<span class="hljs-annotation">@Override</span>
<span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onProgressUpdate</span>(Long... values) { <span class="hljs-comment">/* onPostExecute(values[values.length - 1]); */</span> }

<span class="hljs-annotation">@Override</span>
<span class="hljs-keyword">protected</span> Long <span class="hljs-title">doInBackground</span>(File... dirs) {
    <span class="hljs-keyword">try</span> {
        <span class="hljs-keyword">long</span> totalSize = <span class="hljs-number">0</span>;
        <span class="hljs-keyword">for</span> (File dir : dirs) {
            publishProgress(totalSize);
            totalSize += calculateSize(dir);
        }
        <span class="hljs-keyword">return</span> totalSize;
    } <span class="hljs-keyword">catch</span> (RuntimeException ex) {
        <span class="hljs-keyword">final</span> String message = String.format(<span class="hljs-string">"Cannot get size of %s: %s"</span>, Arrays.toString(dirs), ex);
        <span class="hljs-keyword">new</span> Handler(Looper.getMainLooper()).post(<span class="hljs-keyword">new</span> Runnable() {
            <span class="hljs-annotation">@Override</span>
            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">run</span>() {
                resultView.setText(<span class="hljs-string">"error"</span>);
                Toast.makeText(resultView.getContext(), message, Toast.LENGTH_LONG).show();
            }
        });
    }
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>L;
}

<span class="hljs-annotation">@Override</span>
<span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onPostExecute</span>(Long size) {
    String sizeText = android.text.format.Formatter.formatFileSize(resultView.getContext(), size);
    resultView.setText(sizeText);
}

<span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">long</span> <span class="hljs-title">calculateSize</span>(File dir) {
    <span class="hljs-keyword">if</span> (dir == <span class="hljs-keyword">null</span>) <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
    <span class="hljs-keyword">if</span> (!dir.isDirectory()) <span class="hljs-keyword">return</span> dir.length();
    <span class="hljs-keyword">long</span> result = <span class="hljs-number">0</span>;
    File[] children = dir.listFiles();
    <span class="hljs-keyword">if</span> (children != <span class="hljs-keyword">null</span>)
        <span class="hljs-keyword">for</span> (File child : children)
            result += calculateSize(child);
    <span class="hljs-keyword">return</span> result;
}
}</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li></ul></pre></li>
<li><p>指定资源的优先加载顺序：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">    <span class="hljs-comment">//优先加载</span>
    Glide
        .with(context)
        .load(heroImageUrl)
        .priority(Priority.HIGH)
        .into(imageViewHero);
    <span class="hljs-comment">//后加载</span>
    Glide
        .with(context)
        .load(itemImageUrl)
        .priority(Priority.LOW)
        .into(imageViewItem);</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li></ul></pre></li>
<li><p>先显示缩略图，再显示原图：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">    <span class="hljs-comment">//用原图的1/10作为缩略图</span>
    Glide
        .with(<span class="hljs-keyword">this</span>)
        .load(<span class="hljs-string">"http://inthecheesefactory.com/uploads/source/nestedfragment/fragments.png"</span>)
        .thumbnail(<span class="hljs-number">0.1</span>f)
        .into(iv_0);
    <span class="hljs-comment">//用其它图片作为缩略图</span>
    DrawableRequestBuilder&lt;Integer&gt; thumbnailRequest = Glide
        .with(<span class="hljs-keyword">this</span>)
        .load(R.drawable.news);
    Glide.with(<span class="hljs-keyword">this</span>)
        .load(<span class="hljs-string">"http://inthecheesefactory.com/uploads/source/nestedfragment/fragments.png"</span>)
        .thumbnail(thumbnailRequest)
        .into(iv_0);</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li></ul></pre></li>
<li><p>对图片进行裁剪、模糊、滤镜等处理： <br>
推荐使用独立的图片处理库：<a href="https://github.com/wasabeef/glide-transformations" target="_blank">wasabeef/glide-transformations</a>，使用也很简单：</p>

<pre class="prettyprint" name="code"><code class="language-gradle hljs bash has-numbering">    compile <span class="hljs-string">'jp.wasabeef:glide-transformations:2.0.0'</span></code><ul class="pre-numbering" style="opacity: 0;"><li>1</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li></ul></pre>

<p>之后我们就可以使用GenericRequestBuilder或其子类的<code>transform()</code>或<code>bitmapTransform()</code>方法设置图片转换了：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">    <span class="hljs-comment">//圆形裁剪</span>
    Glide.with(<span class="hljs-keyword">this</span>)
        .load(<span class="hljs-string">"http://inthecheesefactory.com/uploads/source/nestedfragment/fragments.png"</span>)
        .bitmapTransform(<span class="hljs-keyword">new</span> CropCircleTransformation(<span class="hljs-keyword">this</span>))
        .into(iv_0);
    <span class="hljs-comment">//圆角处理</span>
    Glide.with(<span class="hljs-keyword">this</span>)
        .load(<span class="hljs-string">"http://inthecheesefactory.com/uploads/source/nestedfragment/fragments.png"</span>)
        .bitmapTransform(<span class="hljs-keyword">new</span> RoundedCornersTransformation(<span class="hljs-keyword">this</span>,<span class="hljs-number">30</span>,<span class="hljs-number">0</span>, RoundedCornersTransformation.CornerType.ALL))
        .into(iv_0);
    <span class="hljs-comment">//灰度处理</span>
    Glide.with(<span class="hljs-keyword">this</span>)
        .load(<span class="hljs-string">"http://inthecheesefactory.com/uploads/source/nestedfragment/fragments.png"</span>)
        .bitmapTransform(<span class="hljs-keyword">new</span> GrayscaleTransformation(<span class="hljs-keyword">this</span>))
        .into(iv_0);
    <span class="hljs-comment">//其它变换...</span></code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li></ul></pre>

<p>可根据情况使用GenericRequestBuilder子类DrawableRequestBuilder的<code>bitmapTransform(Transformation&lt;Bitmap&gt;... bitmapTransformations)</code>，<code>transform(BitmapTransformation... transformations)</code>，<code>transform(Transformation&lt;GifBitmapWrapper&gt;... transformation)</code>，或其子类BitmapRequestBuilder的<code>transform(BitmapTransformation... transformations)</code>，<code>transform(Transformation&lt;Bitmap&gt;... transformations)</code>方法。 <br>
当然如果想自己写Transformation： <br>
最简单的方式就是继承<code>BitmapTransformation</code>：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering"><span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyTransformation</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">BitmapTransformation</span> {</span>

    <span class="hljs-keyword">public</span> <span class="hljs-title">MyTransformation</span>(Context context) {
        <span class="hljs-keyword">super</span>(context);
    }

    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">protected</span> Bitmap <span class="hljs-title">transform</span>(BitmapPool pool, Bitmap toTransform, 
            <span class="hljs-keyword">int</span> outWidth, <span class="hljs-keyword">int</span> outHeight) {
       Bitmap myTransformedBitmap = ... <span class="hljs-comment">//对Bitmap进行各种变换处理。</span>
       <span class="hljs-keyword">return</span> myTransformedBitmap;
    }

    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> String <span class="hljs-title">getId</span>() {
        <span class="hljs-comment">// 返回代表该变换的唯一Id，会作为cache key的一部分。</span>
        <span class="hljs-comment">// 注意：最好不要用getClass().getName()，因为容易受混淆影响。如果变换过程不影响缓存数据，可以返回空字符串。</span>
        <span class="hljs-keyword">return</span> <span class="hljs-string">"com.example.myapp.MyTransformation"</span>;
    }
}</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li></ul></pre>

<p>使用时只需使用<code>transform()</code>或<code>bitmapTransform()</code>方法即可：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">Glide.with(yourFragment)
    .load(yourUrl)
    .asBitmap()
    .transform(<span class="hljs-keyword">new</span> MyTransformation(context))
    .into(yourView);</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul></pre>

<blockquote>
  <p>自定义图片处理时Glide会自动计算View/Target大小，我们不需要传View的宽高，当然你可以使用<code>override(int, int)</code>去改变这种行为。</p>
</blockquote>

<p>自定义图片处理时，为了避免创建大量Bitmap以及减少GC，可以考虑重用Bitmap，这就需要<code>BitmapPool</code>，典型地就是，从Bitmap池中拿一个Bitmap，用这个Bitmap生成一个Canvas, 然后在这个Canvas上画初始的Bitmap并使用Matrix、Paint、或者Shader处理这张图片。 <br>
为了有效并正确重用Bitmap需要遵循以下三条准则：</p>

<ol><li>永远不要把<code>transform()</code>传给你的原始resource或原始Bitmap给<code>recycle()</code>了，更不要放回<code>BitmapPool</code>，因为这些都自动完成了。值得注意的是，任何从<code>BitmapPool</code>取出的用于自定义图片变换的辅助Bitmap，如果不经过<code>transform()</code>方法返回，就必须主动放回<code>BitmapPool</code>或者调用<code>recycle()</code>回收。</li>
<li>如果你从BitmapPool拿出多个Bitmap或不使用你从BitmapPool拿出的一个Bitmap，一定要返回extras给BitmapPool。</li>
<li>如果你的图片处理没有替换原始resource(例如由于一张图片已经匹配了你想要的尺寸，你需要提前返回), transform()`方法就返回原始resource或原始Bitmap。 <br>
如：</li></ol>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">    <span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyTransformation</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">BitmapTransformation</span> {</span>

        <span class="hljs-keyword">public</span> <span class="hljs-title">MyTransformation</span>(Context context) {
            <span class="hljs-keyword">super</span>(context);
        }

        <span class="hljs-annotation">@Override</span>
        <span class="hljs-keyword">protected</span> Bitmap <span class="hljs-title">transform</span>(BitmapPool pool, Bitmap toTransform, <span class="hljs-keyword">int</span> outWidth, <span class="hljs-keyword">int</span> outHeight) {
            Bitmap result = pool.get(outWidth, outHeight, Bitmap.Config.ARGB_8888);
            <span class="hljs-comment">// 如果BitmapPool中找不到符合该条件的Bitmap，get()方法会返回null，就需要我们自己创建Bitmap了</span>
            <span class="hljs-keyword">if</span> (result == <span class="hljs-keyword">null</span>) {
                <span class="hljs-comment">// 如果想让Bitmap支持透明度，就需要使用ARGB_8888</span>
                result = Bitmap.createBitmap(outWidth, outHeight, Bitmap.Config.ARGB_8888);
            }
            <span class="hljs-comment">//创建最终Bitmap的Canvas.</span>
            Canvas canvas = <span class="hljs-keyword">new</span> Canvas(result);
            Paint paint = <span class="hljs-keyword">new</span> Paint();
            paint.setAlpha(<span class="hljs-number">128</span>);
            <span class="hljs-comment">// 将原始Bitmap处理后画到最终Bitmap中</span>
            canvas.drawBitmap(toTransform, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, paint);
            <span class="hljs-comment">// 由于我们的图片处理替换了原始Bitmap，就return我们新的Bitmap就行。</span>
            <span class="hljs-comment">// Glide会自动帮我们回收原始Bitmap。</span>
            <span class="hljs-keyword">return</span> result;
        }

        <span class="hljs-annotation">@Override</span>
        <span class="hljs-keyword">public</span> String <span class="hljs-title">getId</span>() {
            <span class="hljs-comment">// Return some id that uniquely identifies your transformation.</span>
            <span class="hljs-keyword">return</span> <span class="hljs-string">"com.example.myapp.MyTransformation"</span>;
        }
    }</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li></ul></pre>

<p>也可以直接实现<code>Transformation</code>接口，进行更灵活的图片处理，如进行简单地圆角处理：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">RoundedCornersTransformation</span>  <span class="hljs-keyword">implements</span> <span class="hljs-title">Transformation</span>&lt;<span class="hljs-title">Bitmap</span>&gt; {</span>

    <span class="hljs-keyword">private</span> BitmapPool mBitmapPool;
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">int</span> mRadius;

    <span class="hljs-keyword">public</span> <span class="hljs-title">RoundedCornersTransformation</span>(Context context, <span class="hljs-keyword">int</span> mRadius) {
        <span class="hljs-keyword">this</span>(Glide.get(context).getBitmapPool(), mRadius);
    }

    <span class="hljs-keyword">public</span> <span class="hljs-title">RoundedCornersTransformation</span>(BitmapPool mBitmapPool, <span class="hljs-keyword">int</span> mRadius) {
        <span class="hljs-keyword">this</span>.mBitmapPool = mBitmapPool;
        <span class="hljs-keyword">this</span>.mRadius = mRadius;
    }

    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> Resource&lt;Bitmap&gt; <span class="hljs-title">transform</span>(Resource&lt;Bitmap&gt; resource, <span class="hljs-keyword">int</span> outWidth, <span class="hljs-keyword">int</span> outHeight) {
        <span class="hljs-comment">//从其包装类中拿出Bitmap</span>
        Bitmap source = resource.get();
        <span class="hljs-keyword">int</span> width = source.getWidth();
        <span class="hljs-keyword">int</span> height = source.getHeight();
        Bitmap result = mBitmapPool.get(width, height, Bitmap.Config.ARGB_8888);
        <span class="hljs-keyword">if</span> (result == <span class="hljs-keyword">null</span>) {
            result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        }
        Canvas canvas = <span class="hljs-keyword">new</span> Canvas(result);
        <span class="hljs-comment">//以上已经算是教科书式写法了</span>
        Paint paint = <span class="hljs-keyword">new</span> Paint();
        paint.setAntiAlias(<span class="hljs-keyword">true</span>);
        paint.setShader(<span class="hljs-keyword">new</span> BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
        canvas.drawRoundRect(<span class="hljs-keyword">new</span> RectF(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, width, height), mRadius, mRadius, paint);
        <span class="hljs-comment">//返回包装成Resource的最终Bitmap</span>
        <span class="hljs-keyword">return</span> BitmapResource.obtain(result, mBitmapPool);
    }

    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> String <span class="hljs-title">getId</span>() {
        <span class="hljs-keyword">return</span> <span class="hljs-string">"RoundedTransformation(radius="</span> + mRadius + <span class="hljs-string">")"</span>;
    }
}</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li></ul></pre></li>
<li><p>对请求状态进行监听：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MainActivity</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AppCompatActivity</span> {</span>

    <span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> String TAG = <span class="hljs-string">"MainActivity"</span>;

    <span class="hljs-keyword">private</span> ImageView iv_0;
    <span class="hljs-keyword">private</span> LoggingListener mCommonRequestListener;
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onCreate</span>(Bundle savedInstanceState) {
        <span class="hljs-keyword">super</span>.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        iv_0 = (ImageView) findViewById(R.id.iv_0);
        mCommonRequestListener = <span class="hljs-keyword">new</span> LoggingListener&lt;String, GlideDrawable&gt;();
        Glide
                .with(<span class="hljs-keyword">this</span>)
                .load(<span class="hljs-string">"http://inthecheesefactory.com/uploads/source/nestedfragment/fragments.png"</span>)
                .listener(mCommonRequestListener)
                .into(iv_0);
}
}</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li></ul></pre>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering"><span class="hljs-javadoc">/**
*<span class="hljs-javadoctag"> @param</span> &lt;A&gt; model类型
*<span class="hljs-javadoctag"> @param</span> &lt;B&gt; resource类型
*/</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">LoggingListener</span>&lt;<span class="hljs-title">A</span>, <span class="hljs-title">B</span>&gt; <span class="hljs-keyword">implements</span> <span class="hljs-title">RequestListener</span>&lt;<span class="hljs-title">A</span>, <span class="hljs-title">B</span>&gt; {</span>
<span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> <span class="hljs-keyword">int</span> level;
<span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> String name;
<span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> RequestListener&lt;A, B&gt; delegate;

<span class="hljs-keyword">public</span> <span class="hljs-title">LoggingListener</span>() {
    <span class="hljs-keyword">this</span>(<span class="hljs-string">""</span>);
}

<span class="hljs-keyword">public</span> <span class="hljs-title">LoggingListener</span>(@NonNull String name) {
    <span class="hljs-keyword">this</span>(Log.VERBOSE, name);
}

<span class="hljs-keyword">public</span> <span class="hljs-title">LoggingListener</span>(<span class="hljs-keyword">int</span> level, @NonNull String name) {
    <span class="hljs-keyword">this</span>(level, name, <span class="hljs-keyword">null</span>);
}

<span class="hljs-keyword">public</span> <span class="hljs-title">LoggingListener</span>(RequestListener&lt;A, B&gt; delegate) {
    <span class="hljs-keyword">this</span>(Log.VERBOSE, <span class="hljs-string">""</span>, delegate);
}

<span class="hljs-keyword">public</span> <span class="hljs-title">LoggingListener</span>(<span class="hljs-keyword">int</span> level, @NonNull String name, RequestListener&lt;A, B&gt; delegate) {
    <span class="hljs-keyword">this</span>.level = level;
    <span class="hljs-keyword">this</span>.name = name;
    <span class="hljs-keyword">this</span>.delegate = delegate == <span class="hljs-keyword">null</span> ? NoOpRequestListener.&lt;A, B&gt;get() : delegate;
}

<span class="hljs-annotation">@Override</span>
<span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">onException</span>(Exception e, A model, Target&lt;B&gt; target, <span class="hljs-keyword">boolean</span> isFirstResource) {
    android.util.Log.println(level, <span class="hljs-string">"GLIDE"</span>, String.format(Locale.ROOT,
            <span class="hljs-string">"%s.onException(%s, %s, %s, %s)\n%s"</span>,
            name, e, model, strip(target), isFirst(isFirstResource), android.util.Log.getStackTraceString(e)));
    <span class="hljs-keyword">return</span> delegate.onException(e, model, target, isFirstResource);
}

<span class="hljs-annotation">@Override</span>
<span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">onResourceReady</span>(B resource, A model, Target&lt;B&gt; target, <span class="hljs-keyword">boolean</span> isFromMemoryCache,
                               <span class="hljs-keyword">boolean</span> isFirstResource) {
    String resourceString = strip(getResourceDescription(resource));
    String targetString = strip(getTargetDescription(target));
    android.util.Log.println(level, <span class="hljs-string">"GLIDE"</span>, String.format(Locale.ROOT,
            <span class="hljs-string">"%s.onResourceReady(%s, %s, %s, %s, %s)"</span>,
            name, resourceString, model, targetString, isMem(isFromMemoryCache), isFirst(isFirstResource)));
    <span class="hljs-keyword">return</span> delegate.onResourceReady(resource, model, target, isFromMemoryCache, isFirstResource);
}

<span class="hljs-keyword">private</span> String <span class="hljs-title">isMem</span>(<span class="hljs-keyword">boolean</span> isFromMemoryCache) {
    <span class="hljs-keyword">return</span> isFromMemoryCache ? <span class="hljs-string">"sync"</span> : <span class="hljs-string">"async"</span>;
}

<span class="hljs-keyword">private</span> String <span class="hljs-title">isFirst</span>(<span class="hljs-keyword">boolean</span> isFirstResource) {
    <span class="hljs-keyword">return</span> isFirstResource ? <span class="hljs-string">"first"</span> : <span class="hljs-string">"not first"</span>;
}

<span class="hljs-keyword">private</span> String <span class="hljs-title">getTargetDescription</span>(Target&lt;B&gt; target) {
    String result;
    <span class="hljs-keyword">if</span> (target <span class="hljs-keyword">instanceof</span> ViewTarget) {
        View v = ((ViewTarget) target).getView();
        LayoutParams p = v.getLayoutParams();
        result = String.format(Locale.ROOT,
                <span class="hljs-string">"%s(params=%dx%d-&gt;size=%dx%d)"</span>, target, p.width, p.height, v.getWidth(), v.getHeight());
    } <span class="hljs-keyword">else</span> {
        result = String.valueOf(target);
    }
    <span class="hljs-keyword">return</span> result;
}

<span class="hljs-keyword">private</span> String <span class="hljs-title">getResourceDescription</span>(B resource) {
    String result;
    <span class="hljs-keyword">if</span> (resource <span class="hljs-keyword">instanceof</span> Bitmap) {
        Bitmap bm = (Bitmap) resource;
        result = String.format(Locale.ROOT,
                <span class="hljs-string">"%s(%dx%d@%s)"</span>, resource, bm.getWidth(), bm.getHeight(), bm.getConfig());
    } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (resource <span class="hljs-keyword">instanceof</span> BitmapDrawable) {
        Bitmap bm = ((BitmapDrawable) resource).getBitmap();
        result = String.format(Locale.ROOT,
                <span class="hljs-string">"%s(%dx%d@%s)"</span>, resource, bm.getWidth(), bm.getHeight(), bm.getConfig());
    } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (resource <span class="hljs-keyword">instanceof</span> GlideBitmapDrawable) {
        Bitmap bm = ((GlideBitmapDrawable) resource).getBitmap();
        result = String.format(Locale.ROOT,
                <span class="hljs-string">"%s(%dx%d@%s)"</span>, resource, bm.getWidth(), bm.getHeight(), bm.getConfig());
    } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (resource <span class="hljs-keyword">instanceof</span> Drawable) {
        Drawable d = (Drawable) resource;
        result = String.format(Locale.ROOT,
                <span class="hljs-string">"%s(%dx%d)"</span>, resource, d.getIntrinsicWidth(), d.getIntrinsicHeight());
    } <span class="hljs-keyword">else</span> {
        result = String.valueOf(resource);
    }
    <span class="hljs-keyword">return</span> result;
}

<span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> String <span class="hljs-title">strip</span>(Object text) {
    <span class="hljs-keyword">return</span> String.valueOf(text).replaceAll(<span class="hljs-string">"(com|android|net|org)(\\.[a-z]+)+\\."</span>, <span class="hljs-string">""</span>);
}
}</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li><li>55</li><li>56</li><li>57</li><li>58</li><li>59</li><li>60</li><li>61</li><li>62</li><li>63</li><li>64</li><li>65</li><li>66</li><li>67</li><li>68</li><li>69</li><li>70</li><li>71</li><li>72</li><li>73</li><li>74</li><li>75</li><li>76</li><li>77</li><li>78</li><li>79</li><li>80</li><li>81</li><li>82</li><li>83</li><li>84</li><li>85</li><li>86</li><li>87</li><li>88</li><li>89</li><li>90</li><li>91</li><li>92</li><li>93</li><li>94</li><li>95</li><li>96</li><li>97</li><li>98</li><li>99</li></ul><div class="save_code tracking-ad" data-mod="popu_249" style="display: none;"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li><li>55</li><li>56</li><li>57</li><li>58</li><li>59</li><li>60</li><li>61</li><li>62</li><li>63</li><li>64</li><li>65</li><li>66</li><li>67</li><li>68</li><li>69</li><li>70</li><li>71</li><li>72</li><li>73</li><li>74</li><li>75</li><li>76</li><li>77</li><li>78</li><li>79</li><li>80</li><li>81</li><li>82</li><li>83</li><li>84</li><li>85</li><li>86</li><li>87</li><li>88</li><li>89</li><li>90</li><li>91</li><li>92</li><li>93</li><li>94</li><li>95</li><li>96</li><li>97</li><li>98</li><li>99</li></ul></pre>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-keyword">final</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">NoOpRequestListener</span>&lt;<span class="hljs-title">A</span>, <span class="hljs-title">B</span>&gt; <span class="hljs-keyword">implements</span> <span class="hljs-title">RequestListener</span>&lt;<span class="hljs-title">A</span>, <span class="hljs-title">B</span>&gt; {</span>
<span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> RequestListener INSTANCE = <span class="hljs-keyword">new</span> NoOpRequestListener();

<span class="hljs-annotation">@SuppressWarnings</span>(<span class="hljs-string">"unchecked"</span>)
<span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> &lt;A, B&gt; RequestListener&lt;A, B&gt; <span class="hljs-title">get</span>() {
    <span class="hljs-keyword">return</span> INSTANCE;
}

<span class="hljs-keyword">private</span> <span class="hljs-title">NoOpRequestListener</span>() {
}

<span class="hljs-annotation">@Override</span> <span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">onException</span>(Exception e, A a, Target&lt;B&gt; target, <span class="hljs-keyword">boolean</span> b) {
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">false</span>;
}
<span class="hljs-annotation">@Override</span> <span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">onResourceReady</span>(B b, A a, Target&lt;B&gt; target, <span class="hljs-keyword">boolean</span> b2, <span class="hljs-keyword">boolean</span> b1) {
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">false</span>;
}
}</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li></ul></pre>

<p>通过GenericRequestBuilder的<code>listener()</code>方法添加一个<code>RequestListener</code>实现，但要注意，最好不要用匿名类，也不要每次都创建新的监听器，要使用单例进行统一监听处理，以避免不必要的内存申请和不必要的引用。方法最好返回false，以便Glide能继续进行后续处理(如显示error占位符)。</p></li>
<li>对资源的下载进度进行监听： <br>
可以借助OkHttp的拦截器进行进度监听。OkHttp的拦截器官方Sample请移步<a href="https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/Progress.java" target="_blank">这里</a>。我们可以利用这个拦截器进行监听并处理，需要自定义ModelLoader和DataFetcher，具体请详见我的Git：<a href="https://github.com/shangmingchao/ProgressGlide" target="_blank">https://github.com/shangmingchao/ProgressGlide</a>，欢迎Star啊，不过没有太大必要告诉用户图片加载的进度（sjudd和TWiStErRob他们说的）。同时也可以看一下TWiStErRob大神的<a href="https://gist.github.com/TWiStErRob/08d5807e396740e52c90" target="_blank">实现</a>（自备梯子哈~.~）。</li>
</ol>



<h3 id="四-glide有哪些坑"><a name="t8"></a><strong>四. Glide有哪些“坑”？</strong></h3>

<ol>
<li><strong>ImageView的setTag问题</strong> <br>
<strong>问题描述：</strong>如果使用<code>Glide</code>的<code>into(imageView)</code>为ImageView设置图片的同时使用ImageView的<code>setTag(final Object tag)</code>方法，将会导致<code>java.lang.IllegalArgumentException: You must not call setTag() on a view Glide is targeting</code>异常。因为<code>Glide</code>的<code>ViewTarget</code>中通过<code>view.setTag(tag)</code>和<code>view.getTag()</code>标记请求的，由于Android 4.0之前Tag存储在静态map里，如果Glide使用<code>setTag(int key, final Object tag)</code>方法标记请求则可能会导致内存泄露，所以Glide默认使用<code>view.setTag(tag)</code>标记请求，你就不能重复调用了。 <br>
<strong>解决办法：</strong>如果你需要为ImageView设置Tag，<strong>必须</strong>使用<code>setTag(int key, final Object tag)</code>及<code>getTag(int key)</code>方法，其中key必须是合法的资源ID以确保key的唯一性，典型做法就是在资源文件中声明type="id"的item资源。</li>
<li><strong>placeholder()导致的图片变形问题</strong> <br>
<strong>问题描述：</strong>使用<code>.placeholder()</code>方法在某些情况下会导致图片显示的时候出现图片变形的情况。这是因为Glide默认开启的crossFade动画导致的TransitionDrawable绘制异常，详细描述和讨论可以看一下这个<a href="https://github.com/bumptech/glide/issues/363" target="_blank">#363</a> issue。根本原因就是你的placeholder图片和你要加载显示的图片宽高比不一样，而Android的TransitionDrawable无法很好地处理不同宽高比的过渡问题，这的确是个Bug，是Android的也是Glide的。 <br>
<strong>解决办法：</strong>使用.dontAnimate()方法禁用过渡动画，或者使用animate()方法自己写动画，再或者自己修复TransitionDrawable的问题。</li>
<li><p><strong>ImageView的资源回收问题</strong> <br>
<strong>问题描述：</strong>默认情况下，Glide会根据<code>with()</code>使用的Activity或Fragment的生命周期自动调整资源请求以及资源回收。但是如果有很占内存的Fragment或Activity不销毁而仅仅是隐藏视图，那么这些图片资源就没办法及时回收，即使是GC的时候。 <br>
<strong>解决办法：</strong>可以考虑使用<code>WeakReference</code>，如：</p>

<pre class="prettyprint" name="code"><code class="language-java hljs  has-numbering">    <span class="hljs-keyword">final</span> WeakReference&lt;ImageView&gt; imageViewWeakReference = <span class="hljs-keyword">new</span> WeakReference&lt;&gt;(imageView);
    ImageView target = imageViewWeakReference.get();
    <span class="hljs-keyword">if</span> (target != <span class="hljs-keyword">null</span>) {
        Glide.with(context).load(uri).into(target);
    }</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul></pre></li>
<li><strong>ImageView的scaleType问题</strong> <br>
<code>scaleType</code>默认为<code>fitCenter</code>模式，如果你想设置成<code>centerInside</code>，不好意思，3.x还没有这个方法，参见这个<a href="https://github.com/bumptech/glide/issues/591" target="_blank">#591</a> issue，折中的解决办法就是放弃使用<code>centerInside</code>，或者结合<code>android:scaleType="centerInside"</code>和<code>.dontTransform()</code>使用以禁止Glide对资源进行转换。 <br>
如果你想要ImageView的宽高根据图片资源的大小而定(即使用<code>wrap_comtent</code>)，那么你就必须明确告诉Glide我想加载原始资源：使用<code>android:scaleType="center"</code>，或者<code>.dontTransform()</code>，或者<code>.override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)</code>。 <br>
不推荐使用<code>fitXY</code>，因为这样Glide会加载全尺寸图像到内存中而造成不必要的内存占用。</li>
<li><p><strong>异步线程完成后加载图片的崩溃问题</strong> <br>
<strong>问题描述：</strong>通常情况下，异步线程会被约束在Activity生命周期内，所以异步线程完成后使用Glide加载图片是没有问题的。但如果你的异步线程在Activity销毁时没有取消掉，那么异步线程完成后就Glide就无法为一个已销毁的Activity加载图片资源，抛出的异常如下（在with()方法中就进行判断并抛出异常）：</p>

<pre class="prettyprint" name="code"><code class="hljs avrasm has-numbering"><span class="hljs-label">java.lang.IllegalArgumentException:</span> You cannot start a load for a destroyed activity
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.bumptech</span><span class="hljs-preprocessor">.glide</span><span class="hljs-preprocessor">.manager</span><span class="hljs-preprocessor">.RequestManagerRetriever</span><span class="hljs-preprocessor">.assertNotDestroyed</span>(RequestManagerRetriever<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">134</span>)
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.bumptech</span><span class="hljs-preprocessor">.glide</span><span class="hljs-preprocessor">.manager</span><span class="hljs-preprocessor">.RequestManagerRetriever</span><span class="hljs-preprocessor">.get</span>(RequestManagerRetriever<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">102</span>)
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.bumptech</span><span class="hljs-preprocessor">.glide</span><span class="hljs-preprocessor">.Glide</span><span class="hljs-preprocessor">.with</span>(Glide<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">653</span>)
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.frank</span><span class="hljs-preprocessor">.glidedemo</span><span class="hljs-preprocessor">.TestActivity</span><span class="hljs-preprocessor">.onGetDataCompleted</span>(TestActivity<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">23</span>)
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.frank</span><span class="hljs-preprocessor">.glidedemo</span><span class="hljs-preprocessor">.TestActivity</span><span class="hljs-preprocessor">.access</span>$000(TestActivity<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">10</span>)
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.frank</span><span class="hljs-preprocessor">.glidedemo</span><span class="hljs-preprocessor">.TestActivity</span>$BackgroundTask<span class="hljs-preprocessor">.onPostExecute</span>(TestActivity<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">46</span>)
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.frank</span><span class="hljs-preprocessor">.glidedemo</span><span class="hljs-preprocessor">.TestActivity</span>$BackgroundTask<span class="hljs-preprocessor">.onPostExecute</span>(TestActivity<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">28</span>)
    at android<span class="hljs-preprocessor">.os</span><span class="hljs-preprocessor">.AsyncTask</span><span class="hljs-preprocessor">.finish</span>(AsyncTask<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">632</span>)
    at android<span class="hljs-preprocessor">.os</span><span class="hljs-preprocessor">.AsyncTask</span><span class="hljs-preprocessor">.access</span>$600(AsyncTask<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">177</span>)
    at android<span class="hljs-preprocessor">.os</span><span class="hljs-preprocessor">.AsyncTask</span>$InternalHandler<span class="hljs-preprocessor">.handleMessage</span>(AsyncTask<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">645</span>)
    at android<span class="hljs-preprocessor">.os</span><span class="hljs-preprocessor">.Handler</span><span class="hljs-preprocessor">.dispatchMessage</span>(Handler<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">102</span>)
    at android<span class="hljs-preprocessor">.os</span><span class="hljs-preprocessor">.Looper</span><span class="hljs-preprocessor">.loop</span>(Looper<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">157</span>)
    at android<span class="hljs-preprocessor">.app</span><span class="hljs-preprocessor">.ActivityThread</span><span class="hljs-preprocessor">.main</span>(ActivityThread<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">5356</span>)
    at java<span class="hljs-preprocessor">.lang</span><span class="hljs-preprocessor">.reflect</span><span class="hljs-preprocessor">.Method</span><span class="hljs-preprocessor">.invokeNative</span>(Native Method)
    at java<span class="hljs-preprocessor">.lang</span><span class="hljs-preprocessor">.reflect</span><span class="hljs-preprocessor">.Method</span><span class="hljs-preprocessor">.invoke</span>(Method<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">515</span>)
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.android</span><span class="hljs-preprocessor">.internal</span><span class="hljs-preprocessor">.os</span><span class="hljs-preprocessor">.ZygoteInit</span>$MethodAndArgsCaller<span class="hljs-preprocessor">.run</span>(ZygoteInit<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">1265</span>)
    at <span class="hljs-keyword">com</span><span class="hljs-preprocessor">.android</span><span class="hljs-preprocessor">.internal</span><span class="hljs-preprocessor">.os</span><span class="hljs-preprocessor">.ZygoteInit</span><span class="hljs-preprocessor">.main</span>(ZygoteInit<span class="hljs-preprocessor">.java</span>:<span class="hljs-number">1081</span>)
    at dalvik<span class="hljs-preprocessor">.system</span><span class="hljs-preprocessor">.NativeStart</span><span class="hljs-preprocessor">.main</span>(Native Method)
    }</code><ul class="pre-numbering" style="opacity: 0;"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li></ul><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/save_snippets.png"></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li></ul></pre>

<p><strong>解决办法：</strong>正确管理Background Threads(异步线程)，当Activity停止或销毁时，停止所有相关的异步线程，停止所有后续的UI操作。或者加载前使用<code>isFinishing()</code>或<code>isDestroyed()</code>进行限制（不建议这种处理方式）。</p></li>
<li><strong>由于Bitmap复用导致的在某些设备上图片错乱的问题</strong> <br>
<strong>问题描述：</strong> Glide默认使用BitmapPool的方式对应用中用到的Bitmap进行复用，以减少频繁的内存申请和内存回收，而且默认使用的Bitmap模式为RGB565以减少内存开销。但在某些设备上（通常在Galaxy系列5.X设备上很容易复现）某些情况下会出现图片加载错乱的问题，具体详见这个<a href="https://github.com/bumptech/glide/issues/601" target="_blank">#601</a> issue。原因初步确定是OpenGL纹理渲染异常。 <br>
<strong>解决办法：</strong><code>GlideModule</code>使用<code>PREFER_ARGB_8888</code>（Glide4.X已经默认使用该模式了），虽然内存占用比RGB565更多一点，但可以更好地处理有透明度Bitmap的复用问题。或者禁用Bitmap复用<code>setBitmapPool(new BitmapPoolAdapter())</code>来修复这个问题（不推荐这种处理方式）。</li>
</ol>

<hr>

<p>想了解更多，可以看一下这几篇翻译：</p>

<ul>
<li><a href="http://blog.csdn.net/shangmingchao/article/details/51172972" target="_blank">Glide使用详解（二）</a></li>
<li><a href="http://blog.csdn.net/shangmingchao/article/details/51026742" target="_blank">Glide之GlideModule</a></li>
<li><a href="http://blog.csdn.net/shangmingchao/article/details/51038529" target="_blank">Glide之Target</a></li>
<li><a href="http://blog.csdn.net/shangmingchao/article/details/51058785" target="_blank">Glide之后台线程加载及缓存资源</a></li>
</ul></div>
        <script type="text/javascript">
            $(function () {
                $('pre.prettyprint code').each(function () {
                    var lines = $(this).text().split('\n').length;
                    var $numbering = $('<ul></ul>').addClass('pre-numbering').hide();
                    $(this).addClass('has-numbering').parent().append($numbering);
                    for (i = 1; i <= lines; i++) {
                        $numbering.append($('<li></li>').text(i));
                    };
                    $numbering.fadeIn(1700);
                });
            });
        </script>
   
</div>




<!-- Baidu Button BEGIN -->




<div class="bdsharebuttonbox tracking-ad bdshare-button-style0-16" style="float: right;" data-mod="popu_172" data-bd-bind="1494565742652">
<a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" class="bds_more" data-cmd="more" style="background-position:0 0 !important; background-image: url(http://bdimg.share.baidu.com/static/api/img/share/icons_0_16.png?v=d754dcc0.png) !important" target="_blank"></a>
<a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间" style="background-position:0 -52px !important" target="_blank"></a>
<a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博" style="background-position:0 -104px !important" target="_blank"></a>
<a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博" style="background-position:0 -260px !important" target="_blank"></a>
<a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" class="bds_renren" data-cmd="renren" title="分享到人人网" style="background-position:0 -208px !important" target="_blank"></a>
<a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" class="bds_weixin" data-cmd="weixin" title="分享到微信" style="background-position:0 -1612px !important" target="_blank"></a>
</div>
<script>window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "1", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {} }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];</script>
<!-- Baidu Button END -->

   <link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/blog_detail.css">

    
<!--172.16.140.11-->

<!-- Baidu Button BEGIN -->
<script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=1536434" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/bds_s_v2.js.下载"></script>

<script type="text/javascript">
    document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script>
<!-- Baidu Button END -->

<script type="text/javascript">
    var fromjs = $("#fromjs");
    if (fromjs.length > 0) {
            $("#fromjs .markdown_views pre").addClass("prettyprint");
            prettyPrint();

            $('pre.prettyprint code').each(function () {
                var lines = $(this).text().split('\n').length;
                var $numbering = $('<ul/>').addClass('pre-numbering').hide();
                $(this).addClass('has-numbering').parent().append($numbering);
                for (i = 1; i <= lines; i++) {
                    $numbering.append($('<li/>').text(i));
                };
                $numbering.fadeIn(1700);
            });

            $('.pre-numbering li').css("color", "#999");
        }

    
    $(".markdown_views a[target!='_blank']").attr("target", "_blank");

    $(".toc a[target='_blank']").attr("target", "");

</script>

 


        <div id="digg" articleid="51125554">
            <dl id="btnDigg" class="digg digg_enable" onclick="btndigga();">
               
                 <dt>顶</dt>
                <dd>35</dd>
            </dl>
           
              
            <dl id="btnBury" class="digg digg_enable" onclick="btnburya();">
              
                  <dt>踩</dt>
                <dd>0</dd>               
            </dl>
            
        </div>
     <div class="tracking-ad" data-mod="popu_222"><a href="javascript:void(0);" target="_blank">&nbsp;</a>   </div>
    <div class="tracking-ad" data-mod="popu_223"> <a href="javascript:void(0);" target="_blank">&nbsp;</a></div>
    <script type="text/javascript">
                function btndigga() {
                    $(".tracking-ad[data-mod='popu_222'] a").click();
                }
                function btnburya() {
                    $(".tracking-ad[data-mod='popu_223'] a").click();
                }
            </script>

   <ul class="article_next_prev">
                <li class="prev_article"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_shangyipian&#39;]);location.href=&#39;/shangmingchao/article/details/51058785&#39;;">上一篇</span><a href="http://blog.csdn.net/shangmingchao/article/details/51058785" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_shangyipian&#39;])">Glide之后台线程加载及缓存资源</a></li>
                <li class="next_article"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_xiayipian&#39;]);location.href=&#39;/shangmingchao/article/details/51172972&#39;;">下一篇</span><a href="http://blog.csdn.net/shangmingchao/article/details/51172972" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_xiayipian&#39;])">Glide使用详解（二）</a></li>
    </ul>

    <div style="clear:both; height:10px;"></div>


        <div class="similar_article" style="">
                <h4>我的同类文章</h4>
                <div class="similar_c" style="margin:20px 0px 0px 0px">
                    <div class="similar_c_t">
                                <label class="similar_cur">
                                    <span style="cursor:pointer" onclick="GetCategoryArticles(&#39;1730835&#39;,&#39;shangmingchao&#39;,&#39;foot&#39;,&#39;51125554&#39;);">Android<em>（28）</em></span>
                                </label>
                    </div>
                   
                    <div class="similar_wrap tracking-ad" data-mod="popu_141" style="max-height:195px;">
                        <a href="http://blog.csdn.net/" style="display:none" target="_blank">http://blog.csdn.net</a>
                        <ul class="similar_list fl"><li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/70312824" id="foot_aritcle_70312824undefined9888983344573112" target="_blank" title="Android权限管理详解">Android权限管理详解</a><span>2017-04-21</span><label><i>阅读</i><b>108</b></label></li> <li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/54668547" id="foot_aritcle_54668547undefined9190595238701618" target="_blank" title="Android软键盘输入详解">Android软键盘输入详解</a><span>2017-01-22</span><label><i>阅读</i><b>255</b></label></li> <li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/51959065" id="foot_aritcle_51959065undefined5922392567495185" target="_blank" title="MD风格之丰富多变Toolbar">MD风格之丰富多变Toolbar</a><span>2016-07-22</span><label><i>阅读</i><b>511</b></label></li> <li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/51456319" id="foot_aritcle_51456319undefined23318803989079262" target="_blank" title="RecyclerView之ItemDecoration详解">RecyclerView之ItemDecoration详解</a><span>2016-05-20</span><label><i>阅读</i><b>5986</b></label></li> <li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/51058785" id="foot_aritcle_51058785undefined01295123558027056" target="_blank" title="Glide之后台线程加载及缓存资源">Glide之后台线程加载及缓存资源</a><span>2016-04-04</span><label><i>阅读</i><b>3932</b></label></li> </ul>

                        <ul class="similar_list fr"><li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/68488992" id="foot_aritcle_68488992undefined0013987746783525878" target="_blank" title="Dagger2 User&#39;s Guide(翻译)">Dagger2 User's Guide(翻译)</a><span>2017-03-30</span><label><i>阅读</i><b>1098</b></label></li> <li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/52303685" id="foot_aritcle_52303685undefined5329918392850181" target="_blank" title="Android时间处理详解">Android时间处理详解</a><span>2016-08-25</span><label><i>阅读</i><b>1401</b></label></li> <li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/51704987" id="foot_aritcle_51704987undefined6426659136851127" target="_blank" title="Invalid double崩溃分析">Invalid double崩溃分析</a><span>2016-06-18</span><label><i>阅读</i><b>1490</b></label></li> <li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/51172972" id="foot_aritcle_51172972undefined0775579791356984" target="_blank" title="Glide使用详解（二）">Glide使用详解（二）</a><span>2016-04-17</span><label><i>阅读</i><b>4759</b></label></li> <li><em>•</em><a href="http://blog.csdn.net/shangmingchao/article/details/51038529" id="foot_aritcle_51038529undefined6661779006716655" target="_blank" title="Glide之Target">Glide之Target</a><span>2016-04-01</span><label><i>阅读</i><b>4204</b></label></li> </ul>
                    <a href="http://blog.csdn.net/shangmingchao/article/category/1730835" class="MoreArticle">更多文章</a></div>
                </div>
            </div>    
    <script type="text/javascript">
        $(function () {
            GetCategoryArticles('1730835', 'shangmingchao','foot','51125554');
        });
    </script>
      
</div>

     <div>
           

         <script type="text/javascript">
             /*博客内容页下方Banner1-960*90，创建于2016-12-13*/
             var cpro_id = "u2843955";
        </script>
        <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/c.js.下载"></script><div id="BAIDU_SSP__wrapper_u2843955_0"><iframe id="iframeu2843955_0" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/mclm.html" width="960" height="90" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="border:0;vertical-align:bottom;margin:0;width:960px;height:90px" allowtransparency="true"></iframe></div>
    </div>

<div id="suggest">
        <div class="mod_more_detail clearfix" style="margin-top:80px;">
                                <h2 class="mod_more_detail_title">
                                    <div class="mod_more_detail_left">我的更多文章</div>
                                </h2>

                                <div class="mod_more_detail_content clearfix " id="mod_more_detail_content">     
                                                     
                                    <div class="mod_more_detail_content_left clearfix">                                       
<li><a href="http://blog.csdn.net/shangmingchao/article/details/51058785" target="_blank">Glide之后台线程加载及缓存资源  (2016-04-04 22:45:10)</a></li><li><a href="http://blog.csdn.net/shangmingchao/article/details/51038529" target="_blank">Glide之Target  (2016-04-01 17:36:20)</a></li>                               </div>

                                    <div class="mod_more_detail_content_right clearfix">
                                                                  <li>
                                                                     <a href="http://blog.csdn.net/shangmingchao/article/details/51026742" target="_blank">Glide之GlideModule  ( 2016-03-31 15:13:49 )</a>
                                                                 </li>
                                         </div>
                                </div>
           </div>                                            

</div>
         <script language="javascript" type="text/javascript">     
             $(function(){
                 $.get("/shangmingchao/svc/GetSuggestContent/51125554",function(data){
                     $("#suggest").html(data);
                 });     
             });             
         </script>  


<style>
.blog-ass-articl dd {
color: #369;
width: 99%; /*修改行*/
float: left;
overflow: hidden;
font: normal normal 12px/23px "SimSun";
height: 23px;
margin: 0;
padding: 0 0 0 10px;
margin-right: 30px;
background: url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;
}
</style>

 <link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/replace.css">

<div id="relate" data-mod="popu_218" class="tracking-ad" style="display: block;">
        <div class="relate_t">
            <h3><span>参考知识库</span></h3>
        </div>
        <div class="relate_c"><dl class="relate_list"><dt><a target="_blank" href="http://lib.csdn.net/base/android"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/1455589744328_328.jpg" alt="img"></a></dt><dd><h4><a target="_blank" href="http://lib.csdn.net/base/android">Android知识库</a></h4><p><label><span>33820</span><em>关注</em><i>|</i><span>2806</span><em>收录</em></label></p></dd></dl><dl class="relate_list"><dt><a target="_blank" href="http://lib.csdn.net/base/dotnet"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/1470876331285_285.jpg" alt="img"></a></dt><dd><h4><a target="_blank" href="http://lib.csdn.net/base/dotnet">.NET知识库</a></h4><p><label><span>3856</span><em>关注</em><i>|</i><span>839</span><em>收录</em></label></p></dd></dl><dl class="relate_list"><dt><a target="_blank" href="http://lib.csdn.net/base/git"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/1460535308634_634.jpg" alt="img"></a></dt><dd><h4><a target="_blank" href="http://lib.csdn.net/base/git">Git知识库</a></h4><p><label><span>6587</span><em>关注</em><i>|</i><span>615</span><em>收录</em></label></p></dd></dl><dl class="relate_list"><dt><a target="_blank" href="http://lib.csdn.net/base/javase"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/1453169124297_297.jpg" alt="img"></a></dt><dd><h4><a target="_blank" href="http://lib.csdn.net/base/javase">Java SE知识库</a></h4><p><label><span>26074</span><em>关注</em><i>|</i><span>578</span><em>收录</em></label></p></dd></dl><dl class="relate_list"><dt><a target="_blank" href="http://lib.csdn.net/base/javaee"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/1456818035722_722.jpg" alt="img"></a></dt><dd><h4><a target="_blank" href="http://lib.csdn.net/base/javaee">Java EE知识库</a></h4><p><label><span>18130</span><em>关注</em><i>|</i><span>1334</span><em>收录</em></label></p></dd></dl><dl class="relate_list"><dt><a target="_blank" href="http://lib.csdn.net/base/java"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/1453701371636_636.jpg" alt="img"></a></dt><dd><h4><a target="_blank" href="http://lib.csdn.net/base/java">Java 知识库</a></h4><p><label><span>26481</span><em>关注</em><i>|</i><span>1476</span><em>收录</em></label></p></dd></dl></div>
</div>
 

<dl class="blog-ass-articl" id="res-relatived"> 
    <div class="embody embody_b" id="libkeyparent" style="display:none">
            <span class="embody_t">更多资料请参考：</span>
            <div class="embody_c" id="libkey"></div>
    </div>


     <dt><span>猜你在找</span></dt>    


   


    <div id="adCollege" style="width: 42%;float: left;"> 
        <script src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/job_reco.js.下载" type="text/javascript"></script> 
        <script type="text/javascript">
            csdn.position.showEdu({
                sourceType: "blog",
                searchType: "detail",
                searchKey: "51125554",
                username: "jiangsheng1987",
                recordcount: "5",
                containerId: "adCollege" //容器DIV的id。 
            });
            
            setEduLoc();

            function setEduLoc() {               
                var edus = $("#adCollege div dd a");
                if (edus.length == 0) {
                    setTimeout(function () {
                        setEduLoc();
                    }, 500);
                }
                else {
                    var eduLoc = "?ref=blog&loc=0";
                    $.each(edus, function (index,item) {
                        var href = $(this).attr("href") + eduLoc;
                        $(this).attr("href", href);
                    });
                }
            }

        </script> 
    <div class="tracking-ad" data-mod="popu_84"><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/4787?ref=blog&amp;loc=0" title="不用购买商用证书也可以上线苹果APP" strategy="v4:content" target="_blank">不用购买商用证书也可以上线苹果APP</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/4693?ref=blog&amp;loc=0" title="Mui,h5+,CastApp-APP实战项目-仿e袋洗-O2O类" strategy="v4:content" target="_blank">Mui,h5+,CastApp-APP实战项目-仿e袋洗-O2O类</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/1840?ref=blog&amp;loc=0" title="Web APP设计与实现" strategy="v4:content" target="_blank">Web APP设计与实现</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/4702?ref=blog&amp;loc=0" title="Mui,h5+,CastApp-APP实战项目-仿今日头条" strategy="v4:content" target="_blank">Mui,h5+,CastApp-APP实战项目-仿今日头条</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/3642?ref=blog&amp;loc=0" title="Android开发高级组件与框架——APP上线" strategy="v4:content" target="_blank">Android开发高级组件与框架——APP上线</a></dd></div></div>  

    
     <div id="res" data-mod="popu_36" class="tracking-ad" style="width: 42%; float: left; margin-right: 30px; display: block;"><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="http://blog.csdn.net/wtmoon/article/details/52935497" title="Glide框架的使用及详解" strategy="SearchAlgorithm" target="_blank">Glide框架的使用及详解</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="http://blog.csdn.net/u010052279/article/details/52123788" title="Android 平滑图片加载和缓存库 Glide 使用详解" strategy="SearchAlgorithm" target="_blank">Android 平滑图片加载和缓存库 Glide 使用详解</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="http://blog.csdn.net/axi295309066/article/details/60573610" title="Android平滑图片加载和缓存库Glide使用详解" strategy="SearchAlgorithm" target="_blank">Android平滑图片加载和缓存库Glide使用详解</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="http://blog.csdn.net/EaskShark/article/details/51374049" title="关于Glide图片加载框架的使用详解" strategy="SearchAlgorithm" target="_blank">关于Glide图片加载框架的使用详解</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="http://blog.csdn.net/luanxuye/article/details/60128624" title="Glide使用详解二" strategy="SearchAlgorithm" target="_blank">Glide使用详解二</a></dd></div>
   
</dl>





    <div id="ad_cen">        
                <div>
                                    <div class="J_adv" data-view="true" data-mod="ad_popu_199" data-mtp="43" data-order="114" data-con="ad_content_1843" style="width: 960px; height: 90px;">
                                             <script type="text/javascript">
                                                 /*博客内容页下方Banner2-960*90，创建于,2016-11-28*/
                                                 var cpro_id = "u2831143";
                                            </script>
                                            <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/c.js.下载"></script><div id="BAIDU_SSP__wrapper_u2831143_0"><iframe id="iframeu2831143_0" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/mclm(1).html" width="960" height="90" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="border:0;vertical-align:bottom;margin:0;width:960px;height:90px" allowtransparency="true"></iframe></div>
                                   </div>
                    </div>
    </div>  

        <!-- 广告位开始 -->
        <!-- 广告位结束 -->
<div class="J_adv" data-view="true" data-mod="ad_popu_72" data-mtp="62" data-order="40" data-con="ad_content_2072">
                 <script id="popuLayer_js_q" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/popuLayer.js.下载" defer="defer" type="text/javascript"></script>
            <div id="layerd" style="position: fixed; bottom: 0px; right: 0px; line-height: 0px; z-index: 1000; width: 300px; height: 278px; display: none;">
    	            <div class="J_close layer_close" style="display:;background-color:#efefef;padding:0px;color:#333;font:12px/24px Helvetica,Tahoma,Arial,sans-serif;text-align:right;">关闭</div><!-- 广告占位容器 --><div id="cpro_u2895327"><iframe id="iframeu2895327_0" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/mclm(2).html" width="300" height="250" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="border:0;vertical-align:bottom;margin:0;width:300px;height:250px" allowtransparency="true"></iframe></div></div>
            <script>  document.getElementById("popuLayer_js_q").onload=function(){      var styObjd=styObj={width:"300px","height":parseInt(250)+28};window.CSDN.Layer.PopuLayer("#layerd",{storageName:"layerd",styleObj:styObjd,total:50,expoire:1000*60});  }</script><!-- 投放代码 --><script type="text/javascript">                /*服务器频道首页置顶Banner960*90，创建于2014-7-3*/    (window.cproArray = window.cproArray || []).push({        id: "u2895327"      });  </script>  <script src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/c.js.下载" type="text/javascript"></script>
     
</div>

<div class="comment_class">
    <div id="comment_title" class="panel_head">
        <span class="see_comment">查看评论</span><a name="comments"></a></div>
    <div id="comment_list"><dl class="comment_item comment_topic" id="comment_item_6691664"><dt class="comment_head" floor="29">29楼 <span class="user"><a class="username" href="http://blog.csdn.net/sinat_37489275" target="_blank">sinat_37489275</a> <span class="ptime">2017-03-22 11:21发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6691664" username="sinat_37489275"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/sinat_37489275" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_sinat_37489275.jpg" width="40" height="40"></a></dd><dd class="comment_body">Glide的使用，我觉得这里讲的也挺好的<br>http://blog.csdn.net/shy_745921/article/details/64905955</dd><dl class="comment_item comment_reply" id="comment_item_6749759"><dt class="comment_head" floor="29">Re: <span class="user"><a class="username" href="http://blog.csdn.net/seaker_" target="_blank">seaker_</a> <span class="ptime">2017-04-13 17:59发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6749759" username="seaker_"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/seaker_" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_seaker_.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复sinat_37489275：哥们你是在逗我吗</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6689711"><dt class="comment_head" floor="28">28楼 <span class="user"><a class="username" href="http://blog.csdn.net/Nevilco" target="_blank">Nevil_CSDN</a> <span class="ptime">2017-03-21 16:49发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6689711" username="Nevilco"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/Nevilco" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_nevilco.jpg" width="40" height="40"></a></dd><dd class="comment_body">感谢博主文章，帮我解决了5.0以下因为.placeholder()导致图片变形的问题</dd></dl><dl class="comment_item comment_topic" id="comment_item_6654496"><dt class="comment_head" floor="27">27楼 <span class="user"><a class="username" href="http://blog.csdn.net/Y2408509787" target="_blank">blackguardly</a> <span class="ptime">2017-03-07 10:55发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6654496" username="Y2408509787"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/Y2408509787" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_y2408509787.jpg" width="40" height="40"></a></dd><dd class="comment_body">Mark</dd></dl><dl class="comment_item comment_topic" id="comment_item_6628302"><dt class="comment_head" floor="26">26楼 <span class="user"><a class="username" href="http://blog.csdn.net/qq_28302795" target="_blank">qq_28302795</a> <span class="ptime">2017-02-27 13:52发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6628302" username="qq_28302795"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/qq_28302795" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_qq_28302795.jpg" width="40" height="40"></a></dd><dd class="comment_body">对资源的加载进度监听的时候我的ondownloading方法不会执行，获取不到进度</dd><dl class="comment_item comment_reply" id="comment_item_6628971"><dt class="comment_head" floor="26">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2017-02-27 15:50发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6628971" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复qq_28302795：重点检查这两项：需要调用ProgressTarget的setModel方法指定model对象；需要在AndroidManifest.xml中配置OkHttpProgressGlideModule。</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6492585"><dt class="comment_head" floor="25">25楼 <span class="user"><a class="username" href="http://blog.csdn.net/demon_die" target="_blank">demon_die</a> <span class="ptime">2016-12-19 11:17发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6492585" username="demon_die"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/demon_die" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_demon_die.jpg" width="40" height="40"></a></dd><dd class="comment_body">很赞，多谢博主分享！！！</dd></dl><dl class="comment_item comment_topic" id="comment_item_6488441"><dt class="comment_head" floor="24">24楼 <span class="user"><a class="username" href="http://blog.csdn.net/u010996311" target="_blank">Dede12133</a> <span class="ptime">2016-12-16 16:37发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6488441" username="u010996311"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/u010996311" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_u010996311.jpg" width="40" height="40"></a></dd><dd class="comment_body">我用glide加载了几张很大(一张400k左右)的图片,结果页面变得很卡,glide 有什么方法可以压缩一下么?</dd><dl class="comment_item comment_reply" id="comment_item_6493307"><dt class="comment_head" floor="24">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-12-19 15:24发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6493307" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复Dede12133：View的宽高最好固定，scaleType最好不要是fitXY，以便Glide可以根据View尺寸对资源进行合理的变换处理，可以考虑二次采样：[subsampling-scale-image-view](https://github.com/davemorrissey/subsampling-scale-image-view)，或者利用`into(int, int)`或`downloadOnly(int, int)`先作为File文件形式暂存下来再作进一步处理。</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6459608"><dt class="comment_head" floor="23">23楼 <span class="user"><a class="username" href="http://blog.csdn.net/f305176014" target="_blank">f305176014</a> <span class="ptime">2016-12-03 00:53发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6459608" username="f305176014"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/f305176014" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_f305176014.jpg" width="40" height="40"></a></dd><dd class="comment_body">写的真好，赞一个~</dd></dl><dl class="comment_item comment_topic" id="comment_item_6407851"><dt class="comment_head" floor="22">22楼 <span class="user"><a class="username" href="http://blog.csdn.net/A448955639" target="_blank">帅风_</a> <span class="ptime">2016-11-14 11:01发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6407851" username="A448955639"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/A448955639" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_a448955639.jpg" width="40" height="40"></a></dd><dd class="comment_body">楼主，报错啊 Error:Could not find glide-parent:library:unspecified</dd><dl class="comment_item comment_reply" id="comment_item_6409663"><dt class="comment_head" floor="22">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-11-15 09:18发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6409663" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复帅风_：你应该是集成OkHttp时报错的吧，注意OkHttp 2.x和OkHttp 3.x需使用不同的集成库，确保网络状态良好可以成功从Bintrary拉取aar或jar</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6337772"><dt class="comment_head" floor="21">21楼 <span class="user"><a class="username" href="http://blog.csdn.net/qq_30108311" target="_blank">青年大树</a> <span class="ptime">2016-10-14 16:50发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6337772" username="qq_30108311"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/qq_30108311" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_qq_30108311.jpg" width="40" height="40"></a></dd><dd class="comment_body">楼主 ， 我还是没明白怎么加载htts</dd></dl><dl class="comment_item comment_topic" id="comment_item_6322211"><dt class="comment_head" floor="20">20楼 <span class="user"><a class="username" href="http://blog.csdn.net/hust_twj" target="_blank">hust_twj</a> <span class="ptime">2016-10-08 22:18发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6322211" username="hust_twj"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/hust_twj" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_hust_twj.jpg" width="40" height="40"></a></dd><dd class="comment_body">好文，mark~谢谢博主</dd><dl class="comment_item comment_reply" id="comment_item_6328947"><dt class="comment_head" floor="20">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-10-10 09:35发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6328947" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复hust_twj：谢谢！</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6315082"><dt class="comment_head" floor="19">19楼 <span class="user"><a class="username" href="http://blog.csdn.net/u011710991" target="_blank">cp7719</a> <span class="ptime">2016-10-05 14:24发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6315082" username="u011710991"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/u011710991" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_u011710991.jpg" width="40" height="40"></a></dd><dd class="comment_body">写的很好</dd><dl class="comment_item comment_reply" id="comment_item_6315791"><dt class="comment_head" floor="19">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-10-06 09:21发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6315791" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复cp7719：谢谢！</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6269200"><dt class="comment_head" floor="18">18楼 <span class="user"><a class="username" href="http://blog.csdn.net/zoulux" target="_blank">追风骚年</a> <span class="ptime">2016-09-12 08:41发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6269200" username="zoulux"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/zoulux" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_zoulux.jpg" width="40" height="40"></a></dd><dd class="comment_body">你好 请问glide的context可以传imageView的Context吗 ，会不会出现问题</dd><dl class="comment_item comment_reply" id="comment_item_6271225"><dt class="comment_head" floor="18">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-09-13 09:36发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6271225" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复追风骚年：ImageView的上下文一般是Activity，如果不是后台线程下载的话是可以使用的，但如果是后台线程加载缓存资源的话，为了避免内存泄露最好使用Application上下文。</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6252201"><dt class="comment_head" floor="17">17楼 <span class="user"><a class="username" href="http://blog.csdn.net/A448955639" target="_blank">帅风_</a> <span class="ptime">2016-09-01 00:04发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6252201" username="A448955639"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/A448955639" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_a448955639.jpg" width="40" height="40"></a></dd><dd class="comment_body">MARK 给力</dd></dl><dl class="comment_item comment_topic" id="comment_item_6241280"><dt class="comment_head" floor="16">16楼 <span class="user"><a class="username" href="http://blog.csdn.net/tianjia1872954551" target="_blank">springreef</a> <span class="ptime">2016-08-30 15:29发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6241280" username="tianjia1872954551"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/tianjia1872954551" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_tianjia1872954551.jpg" width="40" height="40"></a></dd><dd class="comment_body">写的很好，马一个</dd><dl class="comment_item comment_reply" id="comment_item_6245281"><dt class="comment_head" floor="16">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-08-31 09:25发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6245281" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复springreef：谢谢！</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6212066"><dt class="comment_head" floor="15">15楼 <span class="user"><a class="username" href="http://blog.csdn.net/qq_26411333" target="_blank">尹凯文</a> <span class="ptime">2016-08-15 16:59发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6212066" username="qq_26411333"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/qq_26411333" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_qq_26411333.jpg" width="40" height="40"></a></dd><dd class="comment_body">使用Glide加载出来的图片，如何获取他的图片路径（也就是在本地缓存的文件）？</dd><dl class="comment_item comment_reply" id="comment_item_6212131"><dt class="comment_head" floor="15">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-08-15 17:27发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6212131" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复尹凯文：默认缓存路径为/data/data/your_package_name/image_manager_disk_cache/，可以通过自定义DiskCache.Factory指定缓存路径和缓存大小，具体可以看这篇翻译：http://blog.csdn.net/shangmingchao/article/details/51026742</dd><dl class="comment_item comment_reply" id="comment_item_6213393"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/qq_26411333" target="_blank">尹凯文</a> <span class="ptime">2016-08-16 13:26发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6213393" username="qq_26411333"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/qq_26411333" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_qq_26411333.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复shangmingchao：3q</dd></dl></dl></dl><dl class="comment_item comment_topic" id="comment_item_6176539"><dt class="comment_head" floor="14">14楼 <span class="user"><a class="username" href="http://blog.csdn.net/sinat_26096133" target="_blank">sinat_26096133</a> <span class="ptime">2016-08-06 20:36发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6176539" username="sinat_26096133"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/sinat_26096133" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_sinat_26096133.jpg" width="40" height="40"></a></dd><dd class="comment_body">请问为什么要配置混肴规则这里。。。是在buildTypes里么？</dd><dl class="comment_item comment_reply" id="comment_item_6176809"><dt class="comment_head" floor="14">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-08-07 10:46发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6176809" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复sinat_26096133：如果你构建时没有进行混淆，可以不配置这个混淆规则的，否则就要在混淆文件（一般是proguard-project.txt文件）配置混淆规则以避免Glide相关类被混淆。</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6169445"><dt class="comment_head" floor="13">13楼 <span class="user"><a class="username" href="http://blog.csdn.net/wswj1314" target="_blank">wswj1314</a> <span class="ptime">2016-08-02 17:18发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6169445" username="wswj1314"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/wswj1314" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_wswj1314.jpg" width="40" height="40"></a></dd><dd class="comment_body">赞一个，楼主加油</dd><dl class="comment_item comment_reply" id="comment_item_6176811"><dt class="comment_head" floor="13">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-08-07 10:47发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6176811" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复wswj1314：谢谢！</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6118362"><dt class="comment_head" floor="12">12楼 <span class="user"><a class="username" href="http://blog.csdn.net/shuyou612" target="_blank">sendtion</a> <span class="ptime">2016-07-06 11:53发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6118362" username="shuyou612"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shuyou612" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shuyou612.jpg" width="40" height="40"></a></dd><dd class="comment_body">写的不错，赞一个</dd></dl><dl class="comment_item comment_topic" id="comment_item_6112431"><dt class="comment_head" floor="11">11楼 <span class="user"><a class="username" href="http://blog.csdn.net/XiaoYouSiFang" target="_blank">KaneTing</a> <span class="ptime">2016-07-01 10:51发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6112431" username="XiaoYouSiFang"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/XiaoYouSiFang" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_xiaoyousifang.jpg" width="40" height="40"></a></dd><dd class="comment_body"><fieldset><legend>引用“shangmingchao”的评论：</legend>回复XiaoYouSiFang：嗯，私信我吧</fieldset><br>嗯，不好意思，前两天有些忙碌，才看到你的回复。我看了下私信发送好像有字数限制，所以我发邮件向你请教了，麻烦你了！</dd></dl><dl class="comment_item comment_topic" id="comment_item_6091851"><dt class="comment_head" floor="10">10楼 <span class="user"><a class="username" href="http://blog.csdn.net/XiaoYouSiFang" target="_blank">KaneTing</a> <span class="ptime">2016-06-22 18:30发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6091851" username="XiaoYouSiFang"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/XiaoYouSiFang" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_xiaoyousifang.jpg" width="40" height="40"></a></dd><dd class="comment_body">刚从Picasso切换到Glide，发现图片显示变得流畅了，使用的内存也减少了。不过有些细节点不是很了解，能否加下你QQ咨询下，谢谢！</dd><dl class="comment_item comment_reply" id="comment_item_6091862"><dt class="comment_head" floor="10">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-06-22 18:45发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6091862" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复KaneTing：嗯，私信我吧</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6091236"><dt class="comment_head" floor="9">9楼 <span class="user"><a class="username" href="http://blog.csdn.net/u011733020" target="_blank">CodingForAndroid</a> <span class="ptime">2016-06-22 13:38发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6091236" username="u011733020"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/u011733020" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_u011733020.jpg" width="40" height="40"></a></dd><dd class="comment_body">LZ 你用AndroidStudio  编译过 Glide 工程吗？ 我这里报错<br>Gradle 'glide-master' project refresh failed<br>Error:Process 'command 'git'' finished with non-zero exit value 128，ＬＺ 可曾遇到过？</dd><dl class="comment_item comment_reply" id="comment_item_6091854"><dt class="comment_head" floor="9">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-06-22 18:34发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6091854" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复CodingForAndroid：可以将settings.gradle的git更换成本地Git："C:/Program Files/Git/cmd/git"，不过org.robolectric.gradle:gradle-android-test-plugin插件始终下不下来。。。</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6088716"><dt class="comment_head" floor="8">8楼 <span class="user"><a class="username" href="http://blog.csdn.net/yuanfengs" target="_blank">yuanfengs</a> <span class="ptime">2016-06-20 10:56发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display: none;" commentid="6088716" username="yuanfengs"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/yuanfengs" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_yuanfengs.jpg" width="40" height="40"></a></dd><dd class="comment_body">谢谢楼主分享，写的很不错，不过在实际使用中用transform转换显示圆角图片，碰到一个问题，服务器给的url的资源是原图，在一个listveiw列表中显示，有的iteam是九宫格显示多张图片，这样转换的时候经常都会报oom，用的也是你博文写的这些类似转换类，也试过那个第三方的glide转换库，但是情况都是一样，请问，有类似的解决经验吗，还是有什么地方弄错了。</dd><dl class="comment_item comment_reply" id="comment_item_6088759"><dt class="comment_head" floor="8">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-06-20 11:18发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6088759" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复yuanfengs：这种情况属于滚动嵌套滚动，为了避免复用等问题，建议在九宫格GridView设置适配器前先判断是否已经设置过适配器以防止频繁设置适配器（类似这样https://github.com/shangmingchao/CommonAdapter/blob/master/sample/src/main/java/com/frank/sample/ExpandableListActivity.java），而且建议缓存变换后的图片资源。您再试一下，还不行的话私信我。</dd><dl class="comment_item comment_reply" id="comment_item_6102211"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/yuanfengs" target="_blank">yuanfengs</a> <span class="ptime">2016-06-29 09:50发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6102211" username="yuanfengs"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/yuanfengs" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_yuanfengs.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复shangmingchao：博主，上次咨询过你这个问题，不过本身九宫格这个东西是使用一个第三方的开源项目，不是用GridView，而且项目本身不懂为什么，一直存在内存溢出的问题，第一次使用Glide，不是很明白，如果可以的话，可以加下博主qq详细咨询下吗，谢谢了。</dd><dl class="comment_item comment_reply" id="comment_item_6103464"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-06-29 17:13发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6103464" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复yuanfengs：嗯，先私信吧。</dd><dl class="comment_item comment_reply" id="comment_item_6103594" style="margin-left:0;"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/yuanfengs" target="_blank">yuanfengs</a> <span class="ptime">2016-06-29 17:32发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6103594" username="yuanfengs"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/yuanfengs" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_yuanfengs.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复shangmingchao：额，好像发不了，发了显示这个: 联系人已设置权限：不能给联系人发送私信</dd><dl class="comment_item comment_reply" id="comment_item_6103625" style="margin-left:0;"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-06-29 17:37发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6103625" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复yuanfengs：我给你发了，收到了没？我邮箱smchao1993@163.com</dd><dl class="comment_item comment_reply" id="comment_item_6103791" style="margin-left:0;"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/yuanfengs" target="_blank">yuanfengs</a> <span class="ptime">2016-06-29 18:03发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6103791" username="yuanfengs"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/yuanfengs" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_yuanfengs.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复shangmingchao：已经发你邮箱，有空查收下，谢谢！</dd></dl><dl class="comment_item comment_reply" id="comment_item_6103718" style="margin-left:0;"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/yuanfengs" target="_blank">yuanfengs</a> <span class="ptime">2016-06-29 17:53发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6103718" username="yuanfengs"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/yuanfengs" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_yuanfengs.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复shangmingchao：收到，谢谢！~</dd></dl></dl></dl></dl></dl></dl></dl><dl class="comment_item comment_topic" id="comment_item_6085062"><dt class="comment_head" floor="7">7楼 <span class="user"><a class="username" href="http://blog.csdn.net/song_1005" target="_blank">曾子布</a> <span class="ptime">2016-06-16 09:45发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6085062" username="song_1005"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/song_1005" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_song_1005.jpg" width="40" height="40"></a></dd><dd class="comment_body">Mark</dd></dl><dl class="comment_item comment_topic" id="comment_item_6082048"><dt class="comment_head" floor="6">6楼 <span class="user"><a class="username" href="http://blog.csdn.net/jasperu" target="_blank">jasperu</a> <span class="ptime">2016-06-13 16:40发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6082048" username="jasperu"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/jasperu" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_jasperu.jpg" width="40" height="40"></a></dd><dd class="comment_body">谢谢比较详细，一离开开发好久了。今天一个朋友刚开始学习这个，让我和他说一下图片加载，我推荐了glide，然后有幸来到你的blog。把你这篇文章分享给了他，然他知道还有一些配置选项就可以了。谢谢你的文章。</dd><dl class="comment_item comment_reply" id="comment_item_6082677"><dt class="comment_head" floor="6">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-06-14 10:04发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6082677" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复jasperu：谢谢认可啊</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6081709"><dt class="comment_head" floor="5">5楼 <span class="user"><a class="username" href="http://blog.csdn.net/llaughing" target="_blank">llaughing</a> <span class="ptime">2016-06-13 13:25发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6081709" username="llaughing"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/llaughing" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_llaughing.jpg" width="40" height="40"></a></dd><dd class="comment_body">请问下, glide加载本地资源文件,   比如加载一个drawable/a.gif  ,   加载流程是怎样的,  ?      我自己试了一下, 加载本地资源也需要一点时间, 不是即显.    glide加载本地资源难道和网络图片一样-------也是先下载到指定目录, 然后再加载到imageview??</dd><dl class="comment_item comment_reply" id="comment_item_6081952"><dt class="comment_head" floor="5">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-06-13 15:39发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6081952" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复llaughing：因为Glide默认是有渐变动画的，所以不是马上就显示出来，而且Glide默认会缓存变换后的资源，所以资源的解码、变换、缓存等也需要一点时间，但对于滚动列表中的图片加载而言还是很流畅的，显示的视觉体验也很舒服。</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6079448"><dt class="comment_head" floor="4">4楼 <span class="user"><a class="username" href="http://blog.csdn.net/u014492609" target="_blank">痕迹天涯119</a> <span class="ptime">2016-06-11 11:09发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6079448" username="u014492609"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/u014492609" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_u014492609.jpg" width="40" height="40"></a></dd><dd class="comment_body">还有下一篇么，速速讲来，感谢</dd><dl class="comment_item comment_reply" id="comment_item_6081236"><dt class="comment_head" floor="4">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-06-13 09:29发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6081236" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复痕迹天涯119：额……下一篇只写了点BitmapPool，等有时间再补充……</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6047390"><dt class="comment_head" floor="3">3楼 <span class="user"><a class="username" href="http://blog.csdn.net/grp0916" target="_blank">grp0916</a> <span class="ptime">2016-05-24 15:24发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6047390" username="grp0916"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/grp0916" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_grp0916.jpg" width="40" height="40"></a></dd><dd class="comment_body">如果下载图片显示成功，再下回开启没有网络的情况下还会显示之前缓存过的图片么，请速度回答</dd><dl class="comment_item comment_reply" id="comment_item_6047571"><dt class="comment_head" floor="3">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-05-24 16:53发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6047571" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复grp0916：没太理解“再下回开启没有网络的情况下还会显示之前缓存过的图片么”这句话的意思。如果你上次成功加载的ImageView的大小和这次无网络情况下的ImageView的大小一样，可以成功加载，否则需要.diskCacheStrategy(DiskCacheStrategy.SOURCE)或.diskCacheStrategy(DiskCacheStrategy.ALL)才能正常加载已缓存的图片。</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_6033180"><dt class="comment_head" floor="2">2楼 <span class="user"><a class="username" href="http://blog.csdn.net/qie7892683" target="_blank">qie7892683</a> <span class="ptime">2016-05-11 16:59发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6033180" username="qie7892683"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/qie7892683" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_qie7892683.jpg" width="40" height="40"></a></dd><dd class="comment_body">谢谢分享，写的分详细</dd><dl class="comment_item comment_reply" id="comment_item_6035169"><dt class="comment_head" floor="2">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-05-13 09:06发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="6035169" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复qie7892683：谢谢支持！</dd></dl></dl><dl class="comment_item comment_topic" id="comment_item_5985474"><dt class="comment_head" floor="1">1楼 <span class="user"><a class="username" href="http://blog.csdn.net/tyronewj" target="_blank">tyronewj</a> <span class="ptime">2016-04-15 22:30发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="5985474" username="tyronewj"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/tyronewj" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_tyronewj.jpg" width="40" height="40"></a></dd><dd class="comment_body">很给力的介绍，不够貌似glide缺少加载监听...</dd><dl class="comment_item comment_reply" id="comment_item_5987686"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/shangmingchao" target="_blank">shangmingchao</a> <span class="ptime">2016-04-17 23:05发表</span>  <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="5987686" username="shangmingchao"> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/shangmingchao" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/3_shangmingchao.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复tyronewj：可以借助OkHttp的拦截器实现，请详见博客内容。</dd></dl></dl><div class="clear"></div></div>
    <div id="comment_bar" style="display: none;">
    </div>
    <div id="comment_form"><a name="commentbox"></a><a name="reply"></a><a name="quote"></a><form action="http://blog.csdn.net/shangmingchao/comment/submit?id=51125554" method="post" onsubmit="return subform(this);"><div class="commentform"><div class="panel_head">发表评论</div><ul><li class="left">用 户 名：</li><li class="right">jiangsheng1987</li></ul><ul><li class="left">评论内容：</li><li class="right" style="position:relative;"><div id="ubbtools"><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#insertcode" code="code"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/code.gif" border="0" alt="插入代码" title="插入代码"></a></div><div id="lang_list" style="position: absolute; top: 28px; left: 0px; display: none;"><a class="long_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#html">HTML/XML</a><a class="long_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#objc">objective-c</a><a class="zhong_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#delphi">Delphi</a><a class="zhong_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#ruby">Ruby</a><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#php">PHP</a><a class="duan_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#csharp">C#</a><a style=" border-right: none;" class="duan_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#cpp">C++</a><a style=" border-bottom:none;" class="long_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#javascript">JavaScript</a><a style=" border-bottom:none;" class="long_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#vb">Visual Basic</a><a style=" border-bottom:none;" class="zhong_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#python">Python</a><a style=" border-bottom:none;" class="zhong_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#java">Java</a><a style="border-bottom:none;" class="duan_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#css">CSS</a><a style="border-bottom:none;" class="duan_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#sql">SQL</a><a style="border:none;" class="duan_name" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#plain">其它</a></div><textarea class="comment_content" name="comment_content" id="comment_content" style="width: 400px; height: 200px;"></textarea></li></ul><ul><input type="hidden" id="comment_replyId" name="comment_replyId"><input type="hidden" id="comment_userId" name="comment_userId" value="521203"><input type="hidden" id="commentId" name="commentId" value=""><input type="submit" class="comment_btn" value="提交">&nbsp;&nbsp;<span id="tip_comment" style="color: Red; display: none;"></span></ul></div></form></div>
    <div class="announce">
        * 以上用户言论只代表其个人观点，不代表CSDN网站的观点或立场<a name="reply"></a><a name="quote"></a></div>
</div>

<script type="text/javascript">
    var fileName = '51125554';
    var commentscount = 56;
    var islock = false
</script>

    <div id="ad_bot">
    </div>
<div id="report_dialog">
</div>

<div id="d-top" style="bottom:60px;">

        <a id="quick-reply" class="btn btn-top q-reply" title="快速回复" style="display:none;">
            <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/blog-icon-reply.png" alt="快速回复">
        </a>    
    <a id="d-top-a" class="btn btn-top backtop" style="display: none;" title="返回顶部" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_huidaodingbu&#39;])">         
         <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/top.png" alt="TOP">
    </a>
</div>
<script type="text/javascript">
    $(function ()
    {
        $("#ad_frm_0").height("90px");
        
        setTimeout(function(){
            $("#ad_frm_2").height("200px");
        },1000);    
    });
  
</script>
<style type="text/css">
    .tag_list
    {
        background: none repeat scroll 0 0 #FFFFFF;
        border: 1px solid #D7CBC1;
        color: #000000;
        font-size: 12px;
        line-height: 20px;
        list-style: none outside none;
        margin: 10px 2% 0 1%;
        padding: 1px;
    }
    .tag_list h5
    {
        background: none repeat scroll 0 0 #E0DBD3;
        color: #47381C;
        font-size: 12px;
        height: 24px;
        line-height: 24px;
        padding: 0 5px;
        margin: 0;
    }
    .tag_list h5 a
    {
        color: #47381C;
    }
    .classify
    {
        margin: 10px 0;
        padding: 4px 12px 8px;
    }
    .classify a
    {
        margin-right: 20px;
        white-space: nowrap;
    }
</style>


<div class="tag_list" style="">

    <h5>
        <a href="http://www.csdn.net/tag/" target="_blank">核心技术类目</a></h5>
    <div class="classify">
<a title="全部主题" href="http://www.csdn.net/tag" target="_blank" onclick="LogClickCount(this,336);">全部主题</a>
<a title="Hadoop" href="http://g.csdn.net/5272865" target="_blank" onclick="LogClickCount(this,336);">Hadoop</a>
<a title="AWS" href="http://g.csdn.net/5272866" target="_blank" onclick="LogClickCount(this,336);">AWS</a>
<a title="移动游戏" href="http://g.csdn.net/5272870" target="_blank" onclick="LogClickCount(this,336);">移动游戏</a>
<a title="Java" href="http://g.csdn.net/5272871" target="_blank" onclick="LogClickCount(this,336);">Java</a>
<a title="Android" href="http://g.csdn.net/5272872" target="_blank" onclick="LogClickCount(this,336);">Android</a>
<a title="iOS" href="http://g.csdn.net/5272873" target="_blank" onclick="LogClickCount(this,336);">iOS</a>
<a title="Swift" href="http://g.csdn.net/5272868" target="_blank" onclick="LogClickCount(this,336);">Swift</a>
<a title="智能硬件" href="http://g.csdn.net/5272869" target="_blank" onclick="LogClickCount(this,336);">智能硬件</a>
<a title="Docker" href="http://g.csdn.net/5272867" target="_blank" onclick="LogClickCount(this,336);">Docker</a>
<a title="OpenStack" href="http://g.csdn.net/5272925" target="_blank" onclick="LogClickCount(this,336);">OpenStack</a>
<a title="VPN" href="http://www.csdn.net/tag/vpn" target="_blank" onclick="LogClickCount(this,336);">VPN</a>
<a title="Spark" href="http://g.csdn.net/5272924" target="_blank" onclick="LogClickCount(this,336);">Spark</a>
<a title="ERP" href="http://www.csdn.net/tag/erp" target="_blank" onclick="LogClickCount(this,336);">ERP</a>
<a title="IE10" href="http://www.csdn.net/tag/ie10" target="_blank" onclick="LogClickCount(this,336);">IE10</a>
<a title="Eclipse" href="http://www.csdn.net/tag/eclipse" target="_blank" onclick="LogClickCount(this,336);">Eclipse</a>
<a title="CRM" href="http://www.csdn.net/tag/crm" target="_blank" onclick="LogClickCount(this,336);">CRM</a>
<a title="JavaScript" href="http://www.csdn.net/tag/javascript" target="_blank" onclick="LogClickCount(this,336);">JavaScript</a>
<a title="数据库" href="http://www.csdn.net/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" target="_blank" onclick="LogClickCount(this,336);">数据库</a>
<a title="Ubuntu" href="http://www.csdn.net/tag/ubuntu" target="_blank" onclick="LogClickCount(this,336);">Ubuntu</a>
<a title="NFC" href="http://www.csdn.net/tag/nfc" target="_blank" onclick="LogClickCount(this,336);">NFC</a>
<a title="WAP" href="http://www.csdn.net/tag/wap" target="_blank" onclick="LogClickCount(this,336);">WAP</a>
<a title="jQuery" href="http://www.csdn.net/tag/jquery" target="_blank" onclick="LogClickCount(this,336);">jQuery</a>
<a title="BI" href="http://www.csdn.net/tag/bi" target="_blank" onclick="LogClickCount(this,336);">BI</a>
<a title="HTML5" href="http://www.csdn.net/tag/html5" target="_blank" onclick="LogClickCount(this,336);">HTML5</a>
<a title="Spring" href="http://www.csdn.net/tag/spring" target="_blank" onclick="LogClickCount(this,336);">Spring</a>
<a title="Apache" href="http://www.csdn.net/tag/apache" target="_blank" onclick="LogClickCount(this,336);">Apache</a>
<a title=".NET" href="http://www.csdn.net/tag/.net" target="_blank" onclick="LogClickCount(this,336);">.NET</a>
<a title="API" href="http://www.csdn.net/tag/api" target="_blank" onclick="LogClickCount(this,336);">API</a>
<a title="HTML" href="http://www.csdn.net/tag/html" target="_blank" onclick="LogClickCount(this,336);">HTML</a>
<a title="SDK" href="http://www.csdn.net/tag/sdk" target="_blank" onclick="LogClickCount(this,336);">SDK</a>
<a title="IIS" href="http://www.csdn.net/tag/iis" target="_blank" onclick="LogClickCount(this,336);">IIS</a>
<a title="Fedora" href="http://www.csdn.net/tag/fedora" target="_blank" onclick="LogClickCount(this,336);">Fedora</a>
<a title="XML" href="http://www.csdn.net/tag/xml" target="_blank" onclick="LogClickCount(this,336);">XML</a>
<a title="LBS" href="http://www.csdn.net/tag/lbs" target="_blank" onclick="LogClickCount(this,336);">LBS</a>
<a title="Unity" href="http://www.csdn.net/tag/unity" target="_blank" onclick="LogClickCount(this,336);">Unity</a>
<a title="Splashtop" href="http://www.csdn.net/tag/splashtop" target="_blank" onclick="LogClickCount(this,336);">Splashtop</a>
<a title="UML" href="http://www.csdn.net/tag/uml" target="_blank" onclick="LogClickCount(this,336);">UML</a>
<a title="components" href="http://www.csdn.net/tag/components" target="_blank" onclick="LogClickCount(this,336);">components</a>
<a title="Windows Mobile" href="http://www.csdn.net/tag/windowsmobile" target="_blank" onclick="LogClickCount(this,336);">Windows Mobile</a>
<a title="Rails" href="http://www.csdn.net/tag/rails" target="_blank" onclick="LogClickCount(this,336);">Rails</a>
<a title="QEMU" href="http://www.csdn.net/tag/qemu" target="_blank" onclick="LogClickCount(this,336);">QEMU</a>
<a title="KDE" href="http://www.csdn.net/tag/kde" target="_blank" onclick="LogClickCount(this,336);">KDE</a>
<a title="Cassandra" href="http://www.csdn.net/tag/cassandra" target="_blank" onclick="LogClickCount(this,336);">Cassandra</a>
<a title="CloudStack" href="http://www.csdn.net/tag/cloudstack" target="_blank" onclick="LogClickCount(this,336);">CloudStack</a>
<a title="FTC" href="http://www.csdn.net/tag/ftc" target="_blank" onclick="LogClickCount(this,336);">FTC</a>
<a title="coremail" href="http://www.csdn.net/tag/coremail" target="_blank" onclick="LogClickCount(this,336);">coremail</a>
<a title="OPhone " href="http://www.csdn.net/tag/ophone" target="_blank" onclick="LogClickCount(this,336);">OPhone </a>
<a title="CouchBase" href="http://www.csdn.net/tag/couchbase" target="_blank" onclick="LogClickCount(this,336);">CouchBase</a>
<a title="云计算" href="http://www.csdn.net/tag/%E4%BA%91%E8%AE%A1%E7%AE%97" target="_blank" onclick="LogClickCount(this,336);">云计算</a>
<a title="iOS6" href="http://www.csdn.net/tag/iOS6" target="_blank" onclick="LogClickCount(this,336);">iOS6</a>
<a title="Rackspace " href="http://www.csdn.net/tag/rackspace" target="_blank" onclick="LogClickCount(this,336);">Rackspace </a>
<a title="Web App" href="http://www.csdn.net/tag/webapp" target="_blank" onclick="LogClickCount(this,336);">Web App</a>
<a title="SpringSide" href="http://www.csdn.net/tag/springside" target="_blank" onclick="LogClickCount(this,336);">SpringSide</a>
<a title="Maemo" href="http://www.csdn.net/tag/maemo" target="_blank" onclick="LogClickCount(this,336);">Maemo</a>
<a title="Compuware" href="http://www.csdn.net/tag/compuware" target="_blank" onclick="LogClickCount(this,336);">Compuware</a>
<a title="大数据" href="http://www.csdn.net/tag/%E5%A4%A7%E6%95%B0%E6%8D%AE" target="_blank" onclick="LogClickCount(this,336);">大数据</a>
<a title="aptech" href="http://www.csdn.net/tag/aptech" target="_blank" onclick="LogClickCount(this,336);">aptech</a>
<a title="Perl" href="http://www.csdn.net/tag/perl" target="_blank" onclick="LogClickCount(this,336);">Perl</a>
<a title="Tornado" href="http://www.csdn.net/tag/tornado" target="_blank" onclick="LogClickCount(this,336);">Tornado</a>
<a title="Ruby" href="http://www.csdn.net/tag/ruby" target="_blank" onclick="LogClickCount(this,336);">Ruby</a>
<a title="Hibernate" href="http://www.csdn.net/tag/hibernate" target="_blank" onclick="LogClickCount(this,336);">Hibernate</a>
<a title="ThinkPHP" href="http://www.csdn.net/tag/thinkphp" target="_blank" onclick="LogClickCount(this,336);">ThinkPHP</a>
<a title="HBase" href="http://www.csdn.net/tag/hbase" target="_blank" onclick="LogClickCount(this,336);">HBase</a>
<a title="Pure" href="http://www.csdn.net/tag/pure" target="_blank" onclick="LogClickCount(this,336);">Pure</a>
<a title="Solr" href="http://www.csdn.net/tag/solr" target="_blank" onclick="LogClickCount(this,336);">Solr</a>
<a title="Angular" href="http://www.csdn.net/tag/angular" target="_blank" onclick="LogClickCount(this,336);">Angular</a>
<a title="Cloud Foundry" href="http://www.csdn.net/tag/cloudfoundry" target="_blank" onclick="LogClickCount(this,336);">Cloud Foundry</a>
<a title="Redis" href="http://www.csdn.net/tag/redis" target="_blank" onclick="LogClickCount(this,336);">Redis</a>
<a title="Scala" href="http://www.csdn.net/tag/scala" target="_blank" onclick="LogClickCount(this,336);">Scala</a>
<a title="Django" href="http://www.csdn.net/tag/django" target="_blank" onclick="LogClickCount(this,336);">Django</a>
<a title="Bootstrap" href="http://www.csdn.net/tag/bootstrap" target="_blank" onclick="LogClickCount(this,336);">Bootstrap</a>
    </div>

</div>
  <script type="text/javascript">     
      $(function(){
              setTimeout(function(){
                  $.get("/shangmingchao/svc/GetTagContent",function(data){
                      $(".tag_list").html(data).show();
                  });     
              });
          },500);                       
 </script> 


<div id="pop_win" style="display:none ;position: absolute; z-index: 10000; border: 1px solid rgb(220, 220, 220); top: 222.5px; left: 630px; opacity: 1; background: none 0px 0px repeat scroll rgb(255, 255, 255);">
    
</div>
<div id="popup_mask"></div>
<style>
    #popup_mask
    {
        position: absolute;
        width: 100%;
        height: 100%;
        background: #000;
        z-index: 9999;
        left: 0px;
        top: 0px;
        opacity: 0.3;
        filter: alpha(opacity=30);
        display: none;
    }

</style>




<script type="text/javascript">
    $(function(){        
        
        setTimeout(function(){
            $(".comment_body:contains('回复')").each(function(index,item){
                var u=$(this).text().split('：')[0].toString().replace("回复","")
                var thisComment=$(this);
                if(u)
                {
                    $.getJSON("https://passport.csdn.net/get/nick?callback=?", {users: u}, function(a) {
                        if(a!=null&&a.data!=null&&a.data.length>0)
                        {
                            nick=a.data[0].n; 
                            if(u!=nick)
                            {
                                thisComment.text(thisComment.text().replace(u,nick));  
                            }
                        }       
                    });  
                }
            });         

        },200);  

        setTimeout(function(){
            $(".math").each(function(index,value){$(this).find("span").last().css("color","#fff"); })
        },5000);

        setTimeout(function(){
            $(".math").each(function(index,value){$(this).find("span").last().css("color","#fff"); })
        },10000);

        setTimeout(function(){
            $(".math").each(function(index,value){$(this).find("span").last().css("color","#fff"); })
        },15000);
        
        setTimeout(function(){
            $("a img[src='http://js.tongji.linezing.com/stats.gif']").parent().css({"position":"absolute","left":"50%"});
        },300);
    });

    function loginbox(){
        var $logpop=$("#pop_win");
        $logpop.html('<iframe src="https://passport.csdn.net/account/loginbox?service=http://static.blog.csdn.net/callback.htm" frameborder="0" height="600" width="400" scrolling="no"></iframe>');

        $('#popup_mask').css({
            opacity: 0.5,
            width: $( document ).width() + 'px',
            height:  $( document ).height() + 'px'
        });
        $('#popup_mask').css("display","block");
 
        $logpop.css( {
            top: ($( window ).height() - $logpop.height())/ 2  + $( window 
       ).scrollTop() + 'px',
            left:($( window ).width() - $logpop.width())/ 2
        } );
 
        setTimeout( function () {
            $logpop.show();
            $logpop.css( {
                opacity: 1
            } );
        }, 200 );
 
        $('#popup_mask').unbind("click");
        $('#popup_mask').bind("click", function(){
            $('#popup_mask').hide();
            var $clopop = $("#pop_win");
            $("#common_ask_div_sc").css("display","none");
            $clopop.css( {
                opacity: 0
            } );
            setTimeout( function () {
                $clopop.hide();
            }, 350 );
            return false;
        });
    }   

    var articletitle='Glide使用详解（一）';

</script>








                        <div class="clear">
                        </div>
                    </div>                   
                
            </div>
                   
           <div id="side">
               
    <div class="side">
<div id="panel_Profile" class="panel">
<ul class="panel_head"><span>个人资料</span></ul>
<ul class="panel_body profile">
<div id="blog_userface">
    <a href="http://my.csdn.net/shangmingchao" target="_blank">
    <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/1_shangmingchao.jpg" title="访问我的空间" style="max-width:90%">
    </a>
    <br>
    <span><a href="http://my.csdn.net/shangmingchao" class="user_name" target="_blank">shangmingchao</a></span>
</div>
<div class="interact">

    <a href="javascript:void(0);" class="attent" id="span_add_follow" title="[加关注]"></a>

 <a href="javascript:void(0);" class="letter" title="[发私信]" onclick="window.open(&#39;http://msg.csdn.net/letters/model?receiver=shangmingchao&#39;,&#39;_blank&#39;,&#39;height=350,width=700&#39;);_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_sixin&#39;])"></a>  
</div>
<div id="blog_medal">
                <div id="bms_box">
                                            <a target="_blank">
                                                    <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/chizhiyiheng.png" onmouseover="m_over_m(this,4)" onmouseout="m_out_m()" alt="2">
                                            </a>
               </div>
</div>
<ul id="blog_rank">
    <li>访问：<span>186125次</span></li>
    <li>积分：<span>1786</span> </li>    
    <li>等级： <span style="position:relative;display:inline-block;z-index:1">
            <img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/blog4.png" alt="" style="vertical-align: middle;" id="leveImg">
            <div id="smallTittle" style=" position: absolute;  left: -24px;  top: 25px;  text-align: center;  width: 101px;  height: 32px;  background-color: #fff;  line-height: 32px;  border: 2px #DDDDDD solid;  box-shadow: 0px 2px 2px rgba (0,0,0,0.1);  display: none;   z-index: 999;">
            <div style="left: 42%;  top: -8px;  position: absolute;  width: 0;  height: 0;  border-left: 10px solid transparent;  border-right: 10px solid transparent;  border-bottom: 8px solid #EAEAEA;"></div>
            积分：1786 </div>
        </span>  </li>
    <li>排名：<span>千里之外</span></li>
</ul>
<ul id="blog_statistics">
    <li>原创：<span>51篇</span></li>
    <li>转载：<span>0篇</span></li>
    <li>译文：<span>7篇</span></li>
    <li>评论：<span>206条</span></li>
</ul>
</ul>
</div>


<div id="hotarticls" class="panel">
<ul class="panel_head">
    <span>       
阅读排行    </span>
</ul>

<ul class="panel_body itemlist">
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51125554" title="Glide使用详解（一）">Glide使用详解（一）</a><span>(48554)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/49763351" title="Bootstrap之侧边导航菜单(可折叠分组)">Bootstrap之侧边导航菜单(可折叠分组)</a><span>(29451)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/49761315" title="Bootstrap之表格checkbox复选框全选">Bootstrap之表格checkbox复选框全选</a><span>(26137)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/23479583" title="HTTP服务器与android客户端的json交互">HTTP服务器与android客户端的json交互</a><span>(9345)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51456319" title="RecyclerView之ItemDecoration详解">RecyclerView之ItemDecoration详解</a><span>(5986)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51026742" title="Glide之GlideModule">Glide之GlideModule</a><span>(5239)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51172972" title="Glide使用详解（二）">Glide使用详解（二）</a><span>(4759)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51038529" title="Glide之Target">Glide之Target</a><span>(4205)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/50244161" title="Android仿QQ长按删除弹出框">Android仿QQ长按删除弹出框</a><span>(4159)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51058785" title="Glide之后台线程加载及缓存资源">Glide之后台线程加载及缓存资源</a><span>(3932)</span>
</li>
</ul>
</div>
<div id="hotarticls2" class="panel">
<ul class="panel_head"><span>评论排行</span></ul>
<ul class="panel_body itemlist">
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51125554" title="Glide使用详解（一）">Glide使用详解（一）</a><span>(56)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/50244161" title="Android仿QQ长按删除弹出框">Android仿QQ长按删除弹出框</a><span>(46)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/23479583" title="HTTP服务器与android客户端的json交互">HTTP服务器与android客户端的json交互</a><span>(27)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/17054801" title="智能自然语言交流系统项目总结">智能自然语言交流系统项目总结</a><span>(15)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/49761315" title="Bootstrap之表格checkbox复选框全选">Bootstrap之表格checkbox复选框全选</a><span>(13)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51456319" title="RecyclerView之ItemDecoration详解">RecyclerView之ItemDecoration详解</a><span>(11)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/50548898" title="Android基于Bmob群聊功能的实现">Android基于Bmob群聊功能的实现</a><span>(10)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/22519573" title="Mysql服务器搭建">Mysql服务器搭建</a><span>(6)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51038529" title="Glide之Target">Glide之Target</a><span>(6)</span>
</li>
<li>
<a href="http://blog.csdn.net/shangmingchao/article/details/51172972" title="Glide使用详解（二）">Glide使用详解（二）</a><span>(4)</span>
</li>
</ul>
</div>
<div id="newcomments" class="panel">
<ul class="panel_head"><span>最新评论</span></ul>
<ul class="panel_body itemlist">
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/50548898#comments">Android基于Bmob群聊功能的实现</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/shangmingchao" class="user_name">shangmingchao</a>:
@liuwei_handsome_so:嗯，已发
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/51125554#comments">Glide使用详解（一）</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/seaker_" class="user_name">seaker_</a>:
@sinat_37489275:哥们你是在逗我吗
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/50244161#comments">Android仿QQ长按删除弹出框</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/shangmingchao" class="user_name">shangmingchao</a>:
@qq_15725813:你用的那个下拉刷新是强制给ListView外面包裹一层容器，并强制给Lis...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/50244161#comments">Android仿QQ长按删除弹出框</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/qq_15725813" class="user_name">qq_15725813</a>:
博主我已经给你发邮件了
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/50244161#comments">Android仿QQ长按删除弹出框</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/shangmingchao" class="user_name">shangmingchao</a>:
@qq_15725813:如果会用Github的话就提个issue或者Email我吧，这样说不清楚，...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/50244161#comments">Android仿QQ长按删除弹出框</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/qq_15725813" class="user_name">qq_15725813</a>:
博主，还有一个问题，就是你用的onTouch方法获取坐标，我的fragment中有下拉刷新功能，每次...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/50244161#comments">Android仿QQ长按删除弹出框</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/qq_15725813" class="user_name">qq_15725813</a>:
博主，还有一个问题，就是你用的onTouch方法获取坐标，我的fragment中有下拉刷新功能，每次...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/50244161#comments">Android仿QQ长按删除弹出框</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/qq_15725813" class="user_name">qq_15725813</a>:
博主，我就是用的github上面最新的代码，可是还是显示在左上角，我的listview并没有绑定on...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/50244161#comments">Android仿QQ长按删除弹出框</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/qq_15725813" class="user_name">qq_15725813</a>:
博主，我就是用的github上面最新的代码，可是还是显示在左上角，我的listview并没有绑定on...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/shangmingchao/article/details/49761315#comments">Bootstrap之表格checkbox复选框全选</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/shangmingchao" class="user_name">shangmingchao</a>:
@wowleao:为了方便选择器不是根据ID或Name而是根据table标签检索的，所以可能会有冲突
    </p>
    </li>
</ul>
</div>
    </div>
    <div class="clear">
    </div>


                 <!-- 广告位开始 --> 
                <!-- 广告位结束 -->
                   <div class="J_adv" data-view="true" data-mod="ad_popu_189" data-mtp="63" data-order="40" data-con="ad_content_1259" style="width: 250px; height: 250px;">
                        <div id="nav_show_top_stop" style="width: 250px; height: 250px; z-index: 1000; position: fixed; top: 0px;"><div id="cpro_u2734133"><iframe id="iframeu2734133_0" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/mclm(3).html" width="250" height="250" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="border:0;vertical-align:bottom;margin:0;width:250px;height:250px" allowtransparency="true"></iframe></div></div>
                   </div>
                    <script>    
                        
                        setTimeout(function () {
                            var naviga_offsetTop = 0; function naviga_stay_top() {
                                var scrollTop = jQuery(document).scrollTop();
                                if (scrollTop > naviga_offsetTop) {
                                    jQuery("#nav_show_top_stop").css({ "position": "fixed" });
                                    jQuery("#nav_show_top_stop").css({ "top": "0px" });
                                } else { jQuery("#nav_show_top_stop").css({ "position": "fixed" }); jQuery("#nav_show_top_stop").css({ "top": naviga_offsetTop - scrollTop + "px" }); }
                            }
                            function onload_function() {
                                naviga_offsetTop = jQuery("#nav_show_top_stop").position().top;
                                jQuery(window).bind("scroll", naviga_stay_top); jQuery(window).bind("mousewheel", naviga_stay_top);
                                jQuery(document).bind("scroll", naviga_stay_top); jQuery(document).bind("mousewheel", naviga_stay_top);
                            } jQuery(document).ready(onload_function);
                        },200);                                   

                    </script>
                    <script type="text/javascript">    (window.cproArray = window.cproArray || []).push({ id: "u2734133" });  </script>
                   <script src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/c.js.下载" type="text/javascript"></script>

           </div>   

            <div class="clear">
            </div>
        </div>

        

<script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/cnick.js.下载"></script>
<script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/newblog.min.js.下载"></script>


<script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/showblogmedal.ashx"></script>
<script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/JavaScript1.js.下载"></script><link rel="stylesheet" type="text/css" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/pub_footer_2014.css"><div class="pub_fo"><div id="pub_footerall" class="pub_footer_new"><dl><dt></dt> <dd class="foot_sub_menu"><a href="http://www.csdn.net/company/about.html" target="_blank">公司简介</a><span>|</span><a href="http://www.csdn.net/company/recruit.html" target="_blank">招贤纳士</a><span>|</span><a href="http://www.csdn.net/company/marketing.html" target="_blank">广告服务</a><span>|</span><a href="http://www.csdn.net/company/contact.html" target="_blank">联系方式</a><span>|</span><a href="http://www.csdn.net/company/statement.html" target="_blank">版权声明</a><span>|</span><a href="http://www.csdn.net/company/layer.html" target="_blank">法律顾问</a><span>|</span><a href="mailto:webmaster@csdn.net">问题报告</a><span>|</span><a target="_blank" href="http://www.csdn.net/friendlink.html">合作伙伴</a><span>|</span><a href="http://bbs.csdn.net/forums/Service" target="_blank">论坛反馈</a></dd><dd class="foot_contact"><a href="javascript:void(0);" target="_blank" class="qq">网站客服</a><a href="http://wpa.qq.com/msgrd?v=3&amp;uin=2251809102&amp;site=qq&amp;menu=yes" target="_blank" class="qq">杂志客服</a><a href="http://e.weibo.com/csdnsupport/profile" target="_blank" class="weibo">微博客服</a><a href="mailto:webmaster@csdn.net" class="email" title="联系邮箱">webmaster@csdn.net</a><span class="phone" title="服务热线">400-600-2320</span><span class="interval">|</span><span>北京创新乐知信息技术有限公司 版权所有</span><span class="interval">|</span><span>江苏知之为计算机有限公司</span><span class="interval">|</span><span>江苏乐知网络技术有限公司</span></dd><dd class="foot_copyright"><span>京&nbsp;ICP&nbsp;证&nbsp;09002463&nbsp;号</span><span class="interval">|</span><span>Copyright © 1999-2016, CSDN.NET, All Rights Reserved&nbsp;</span><a href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010" target="_blank"><img src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/gongshang_logos.gif" alt="GongshangLogo" title=""></a></dd></dl></div></div><div id="note1" class="csdn_note" style="display:none; position:absolute; z-index:9999; width:440px">  <span class="notice_top_arrow"><span class="inner"></span></span>  <div class="box"></div></div><div class="csdn_notice_tip" style="position: absolute; z-index: 9990; width: 170px; left: -72px; top: 11370px; display: block;">  <iframe src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/saved_resource(2).html" frameborder="0" scrolling="no" style="z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;background:transparent"></iframe>  <div class="tip_text">您有<strong>2</strong>条新通知</div>  <a href="javascript:void 0" class="close2"></a></div><script id="noticeScript" type="text/javascript" btnid="header_notice_num" wrapid="note1" count="5" subcount="5" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/notify.js.下载"></script>

<script type="text/javascript">
    $(function () {
        function __get_code_toolbar(snippet_id) {
            return $("<span class='tracking-ad' data-mod='popu_167'><a href='https://code.csdn.net/snippets/"
                    + snippet_id
                    + "' target='_blank' title='在CODE上查看代码片'  style='text-indent:0;'><img src='https://code.csdn.net/assets/CODE_ico.png' width=12 height=12 alt='在CODE上查看代码片' style='position:relative;top:1px;left:2px;'/></a></span>"
                    + "<span class='tracking-ad' data-mod='popu_170'><a href='https://code.csdn.net/snippets/"
                    + snippet_id
                    + "/fork' target='_blank' title='派生到我的代码片' style='text-indent:0;'><img src='https://code.csdn.net/assets/ico_fork.svg' width=12 height=12 alt='派生到我的代码片' style='position:relative;top:2px;left:2px;'/></a></span>");
        }
        
        $("[code_snippet_id]").each(function () {
            __s_id = $(this).attr("code_snippet_id");
            if (__s_id != null && __s_id != "" && __s_id != 0 && parseInt(__s_id) > 70020) {
                __code_tool = __get_code_toolbar(__s_id);
                $(this).prev().find(".tools").append(__code_tool);
            }
        });

        $(".bar").show();
    });
</script>





    </div><input type="hidden" id="aa_g_data_ids">
      <!--new top-->
    

    <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/tracking.js(1).下载" charset="utf-8"></script>  

   
    <script id="csdn-toolbar-id" btnid="header_notice_num" wrapid="note1" count="5" subcount="5" type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/toolbar.js.下载"></script>
     <!--new top-->
   
    <link href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/ask_float_block.css" type="text/css" rel="stylesheet">
    <script language="JavaScript" type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/wmd.js.下载"></script>
    <script language="JavaScript" type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/showdown.js.下载"></script>
    
    <script language="JavaScript" type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/ask_float_block.js.下载"></script>
   

   


        <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/async_new.js.下载"></script>   
         <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/comment.js.下载"></script>
        <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/MathJax.js.下载"></script>
        <link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/prettify.css">
        <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/prettify.js.下载"></script>
        <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/main.js.下载"></script>
        <script type="text/javascript">
            $(function () {
                setTimeout(function () {
                    var searchtitletags = articletitle + ',' + $("#tags").html();
                    searchService({
                        index: 'blog',
                        query: searchtitletags,
                        from: 5,
                        size: 5,
                        appendTo: '#res',
                        url: 'recommend',
                        his: 2,
                        client: "blog_cf_enhance",
                        tmpl: '<dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="#{ url }" title="#{ title }" strategy="#{ strategy }">#{ title }</a></dd>'
                    });
                }, 1000);
            });

         </script>   
        <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/web-storage-cache.min.js.下载"></script>
        <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/replace.min.js.下载"></script>
    


  <div id="a52b5334d" style="width: 1px; height: 1px; display: none;">
                    <script id="adJs52b5334" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/52b5334.js.下载"></script>
                    <script>document.getElementById("adJs52b5334").src = "http://ads.csdn.net/js/opt/52b5334.js?t=" + Math.random();</script>
   </div>

    <link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/blog_code.css">
    <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/saveToCode.js.下载"></script>
      <script type="text/javascript" src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/main.js(1).下载"></script>

    <link rel="stylesheet" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/fa.css">
          
    <div class="pop_CA_cover" style="display:none"></div>
    <div class="pop pop_CA" style="display:none">
          <div class="CA_header">
            收藏助手
            <span class="cancel_icon" id="fapancle" onclick="$(&#39;.pop_CA&#39;).hide();$(&#39;.pop_CA_cover&#39;).hide();"></span>
          </div>
          <iframe src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/saved_resource(3).html" id="fa" frameborder="0" width="100%" height="360" scrolling="no"></iframe>
    </div>


   
 <div id="tag-suggest-pop">
  <div class="relative">
    <div class="close"></div>
    <div class="content"></div>
  </div>
</div><link rel="stylesheet" type="text/css" media="screen" href="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/ask_float_fonts_css-6b30a53970eb5c3a2a045e3df585b475.css"><div data-mod="popu_64" class="csdn-tracking-statistics" chg-blk="0"><a id="com-quick-reply" title="快速回复" style="top:352px"></a><a id="com-quick-collect" title="我要收藏" style="top:390px"></a><a id="com-d-top-a" style="top: 428px; display: inline;" title="返回顶部" onclick=""></a> </div><div class="pop_edit ask_second comm_ask_second"><h3>提问</h3><span class="ask_float_span">您的问题将会被发布在“<a class="ask_float_channel" href="http://ask.csdn.net/" target="_blank" style="cursor:pointer">技术问答</a>”频道</span><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" nodetype="close" class="close">×</a><div class="context"><div class="err_div"><span class="err_ico"></span><span class="err_txt">该问题已存在，请勿重复提问</span></div><div class="input_div"><input id="askInputSecond" type="text" style="font-size:14px;" placeholder="问题标题"></div><div class="cm_box"><div class="cm_dialog"></div> <div class="pop_cm cm_add_link"><input type="text" placeholder="链接内容" id="af_cm_link_txt"><input type="text" placeholder="链接地址" id="af_cm_link_url"><input type="text" placeholder="链接提示" id="af_cm_link_tit"><div class="text-right"><span class="btn btn-default btn-sm" id="add_link_btn">插入链接</span> </div> </div><div class="pop_cm cm_add_img"><div class="nav-tabs"><a class="img_tab active" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#tab_upload">本地上传</a><a class="img_tab" href="http://blog.csdn.net/shangmingchao/article/details/51125554/#tab_weburl">网络图片</a></div><div class="tab_panel active" id="tab_upload"><div class="set_img"><iframe src="./Glide使用详解（一） - 商明超的专栏 - 博客频道 - CSDN.NET_files/upload.html"></iframe></div></div><div class="tab_panel" id="tab_weburl"><input type="text" placeholder="图片地址" id="af_cm_img_url"><input type="text" placeholder="图片说明" id="af_cm_img_alt"><div class="text-right"><span class="btn btn-default btn-sm" id="add_img_btn">插入图片</span> </div></div> </div></div> <textarea id="editor_all" rows="8" style="display: none;"></textarea><div class="editor-toolbar"><i class="separator">|</i><a class="icon-headline" title="标题一（Ctrl+Alt+1）"></a><a class="icon-heading" title="标题二（Ctrl+Alt+2）"></a><a class="icon-bold" title="粗体（Ctrl+B）"></a><a class="icon-italic" title="斜体（Ctrl+I）"></a><i class="separator">|</i><a class="icon-quote-left" title="引用（Ctrl+’）"></a><a class="icon-code" title="插入代码片（Ctrl+,）"></a><a class="icon-list-ul" title="无序列表（Ctrl+L）"></a><a class="icon-list-ol" title="有序列表（Ctrl+Alt+L）"></a><i class="separator">|</i><a class="icon-link" title="添加链接（Ctrl+K）"></a><a class="icon-picture" title="添加图片（Ctrl+Alt+I）"></a><i class="separator">|</i><a class="icon-reply" title="撤退（Ctrl+Z）"></a><a class="icon-share-alt" title="前进（Ctrl+Shift+Z）"></a><i class="separator">|</i><a class="icon-info" href="http://ask.csdn.net/pages/markdown" target="_blank" title="markdown语法参考"></a><a class="icon-preview" title="预览"></a><i class="separator">|</i></div><div class="CodeMirror cm-s-paper CodeMirror-focused"><div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" style="position: absolute; padding: 0px; width: 1000px; height: 1em; outline: none; font-size: 4px;" tabindex="0"></textarea></div><div class="CodeMirror-hscrollbar"><div style="height: 1px;"></div></div><div class="CodeMirror-vscrollbar"><div style="width: 1px;"></div></div><div class="CodeMirror-scrollbar-filler"></div><div class="CodeMirror-gutter-filler"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="min-width: 33px;"><div style="position: relative;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre>&nbsp;<span style="display: inline-block; width: 1px; margin-right: -1px;">&nbsp;</span></pre></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code"></div><div class="CodeMirror-cursor" style="visibility: hidden;">&nbsp;</div><div class="CodeMirror-cursor CodeMirror-secondarycursor" style="visibility: hidden;">&nbsp;</div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px;"></div><div class="CodeMirror-gutters" style="display: none;"></div></div></div><div class="editor-statusbar"><span class="lines">0</span><span class="words">0</span><span class="cursor">0:0</span></div><div class="div_tags clearfix"><div id="divSearchTags" class="tags_con"><input type="text"></div><input type="hidden" name="txtSearchTags"></div><div id="ask2_tagRecomm_div" class="drt_tagRecomm tracking-ad" data-mod="popu_73"><span class="drt_tit">推荐标签：</span></div></div><div class="success"><div class="left_area"><input id="chk_cb" type="checkbox"><span class="wyxs">我要悬赏</span><input id="cb_num" class="cb_num" readonly="true"><span class="phib_rii"><span> 币</span></span></div><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" nodetype="cancel" class="cancel">取消</a><a href="http://blog.csdn.net/shangmingchao/article/details/51125554/#" nodetype="ok" class="ok">发布</a></div></div><div id="common_ask_div_sc" class="searchContainer"><div class="sTitle">可能存在类似的问题：</div><div class="sFooter"><a class="sFirstNewAsk">我想提一个新问题</a></div></div><div id="mask_code"></div><div class="gist_edit"><div class="save_snippets clearfix"><div class="tit"><h3>保存代码片</h3><span>整理和分享保存的代码片，请访问<a href="https://code.csdn.net/snippets_manage" target="_blank">代码笔记</a></span></div><div class="con_form"><ul class="gist_edit_list clearfix"><li><span class="red">*</span><span class="txt">标题</span><input id="form_title" class="form-input" placeholder="Glide使用详解（一）" type="text"></li><li><span class="red">*</span><span class="txt">描述</span><textarea id="form-textarea" class="form-textarea" placeholder="Glide使用详解（一）： http://blog.csdn.net/shangmingchao/article/details/51125554/"></textarea></li><li><span class="red">&nbsp;</span><span class="txt">标签</span><div id="divSearchTags"><span class="label blog_tag"><span>Glide</span><a title="Removing tag" href="javascript:;">x</a></span><span class="label blog_tag"><span>Glide使用</span><a title="Removing tag" href="javascript:;">x</a></span><span class="label blog_tag"><span>Glide详解</span><a title="Removing tag" href="javascript:;">x</a></span><span class="label blog_tag"><span>Glide教程</span><a title="Removing tag" href="javascript:;">x</a></span><input id="insertTag" class="insertTag" placeholder="请输入标签，按Enter生成(最多5项)" type="text" value="" name="insertTag" maxlength="21" style="color: rgb(51, 51, 51);"><input id="OrganTag" class="OrganTag" type="hidden" name="OrganTag" value="Glide,Glide使用,Glide详解,Glide教程,"><input id="OldOrganTag" class="OldOrganTag" type="hidden" name="OldOrganTag" value=""><input type="hidden" name="txtSearchTags"></div></li></ul></div><div class="bottom-bar"><a href="javascript:;" class="btn-submit btn-cancel">取消</a><span class="tracking-ad" data-mod="popu_250"><a class="btn-submit btn-confirm" href="javascript:;" target="_blank">确定</a></span></div></div></div></body></html>